views:

23

answers:

2

I am trying to move text next to my header, but it is not working using margins - when i try to move it all the text boxes move, even though each text box is a seperate div tag.

Here is my code for this part

<body>
<div id="wrapper">
  <div id="header">
    <h4><strong>Qtek Australia</strong></h4>
    <div id="home">Home</div>
    <div id="Aboutus">About us</div>
    <div id="Contactus">Contact us</div>
     <div id="Location">Location</div>

  </div>

i am trying to move the home, about us, contact us and location to the right of the header "Qtek Australia", please help

A: 

You can try wrapping the h4 in another div and placing it where you want. If this is the way you already tried, another way could be wrapping the three div you want to place on the left in one div, the other four in another and move around these two divs. It should be easier, even if you can get divitis doing so.

mg
A: 

I will say that your document semantics are quite vague. You probably don't need to use STRONG inside your heading - it's conceivable that you really mean to emphasize the thought expressed in it, but I suspect that you only want the heading to appear bolder. Use CSS to achieve that, as in: h4 {font-weight:bold; font-size: 14em;}.

It's also conceivable that your page makes the most sense with the navigation starting at the fourth level of some topic, but it's highly unlikely; in the vast majority of cases, the navigation would exists higher up - under h1 or h2.

Your navigation itself would be more coherent if it was an unordered list.

<ul>
    <li>Home</li>
    <li>About Us</li>
    ...
</ul>

This also has the advantage of allowing you to style the navigation elements both as a set and individually.

You probably don't need to be wrapping your elements in all those divs. Most elements in HTML are containers - headings, lists, paragraphs, just about everything can be styled - including positioning and moving - by itself.

For instance, one means of positioning the navigation list to the right of the h4 would be to style the h4 with "display:inline", or "float:left", which would bring the following element (the list) onto the same line. There's a lot of different ways to go about that kind of positioning, and it's not even clear that this is what you're after.

Clarify what you mean; and it would help if you posted whatever CSS or JavaScript you're using.

Superstringcheese
+1 for the approach possibly not fitting the objective. At the risk of committing heresy, sometimes tables aren't that bad for things like this. Modifying the `display` and `float` properties will probably work, though, but beware that float generally doesn't behave consistently unless you're sizing containers explicitly.
Josh
I wouldn't go so far as to call a table heretical either - tables aren't intrinsically bad, they're just probably not the correct structure for expressing the semantics of this implementation. My point was to illustrate that we need more information in order to suggest an effective solution. I agree that my first approach would probably be DISPLAY due to its greater predictability.
Superstringcheese