PDA

View Full Version : onoes. I'm rusty.



loserWILL
18-12-2007, 02:29 AM
Well, I haven't coded in who knows how long. Basically, I'm coding a layout for a new script I'm creating.

It's all going well, but then this happens. :l Instead of the DIVs (for the content box) each going under each other, they go in a line sideways.

Here's the CSS for the navigation boxes:

#ntop {
background-image: url(images/navtop.gif);
width: 197px;
height: 40px;
float: left;
margin-top: 20px;
}

#nmid {
background-image: url(images/navmid.gif);
width: 197px;
float: left;
}

#nbot {
background-image: url(images/navbot.gif);
width: 197px;
height: 10px;
float: left;
}

Here's how I have the DIV HTML code in my body:


<div id="ntop"></div>
<div id="nmid"></div>
<div id="nbot"></div>

Moved by Agesilaus (Forum Moderator) from Design and Development: Please post in the correct forum.

Aflux
18-12-2007, 02:37 AM
Line break.

loserWILL
18-12-2007, 02:40 AM
Line break.

I now have this:

<div id="ntop"></div><br />
<div id="nmid"></div><br />
<div id="nbot"></div><br />

Only the DIVs "navbot & navmid" are together, they aren't connected with navtop.

Invent
18-12-2007, 03:53 PM
So instead of them being like;


[------] [------] [------]


You want them to be like:


[------]
[------]
[------]


? If so, remove the float attribute..

loserWILL
18-12-2007, 09:02 PM
So instead of them being like;


You want them to be like:


? If so, remove the float attribute..

If I remove the float attribute, they don't stay to the left? Or would I create a wrap for them?

php.net
18-12-2007, 09:06 PM
If I remove the float attribute, they don't stay to the left? Or would I create a wrap for them?

They will stay to the left. :)

craigg.
18-12-2007, 09:07 PM
If you want them in a colomn rather than a row, yes you would use a "wrap" or as I call them, a container. Set the width of the container and insert the divs inside the container.

Hope that helped.

loserWILL
18-12-2007, 09:09 PM
Okay, thanks everybody +rep.

Want to hide these adverts? Register an account for free!