DIV Code question

HippySunshine

Senior Member
Probably quite a simple answer, but how do I get my DIV's to flow horizontaly to create a horizontal website? :confused:

Thanks x
 
inline-style.png



Define it in your css, either make all divs float left or just to a certain class.

Code:
div { float:left; }ordiv.horizontal { float:left; }
Resulting in <div class="horizontal"></div> for your html ;)


It's probably wiser to pick the last option because I'm not sure if floating your container div will work out the way you want it to.
 
Onartis said:
inline-style.png



Define it in your css, either make all divs float left or just to a certain class.

Code:
div { float:left; }ordiv.horizontal { float:left; }
Resulting in <div class="horizontal"></div> for your html ;)


It's probably wiser to pick the last option because I'm not sure if floating your container div will work out the way you want it to.

And div.horizontal is a bad class name, as it's stylistic :p
 
I'm sorry Harry, I fail at life :(
But he's right though, using a class such as .post or .article would be more suitable :p
 
i always put all my css in an external file and link to the file in the header,
if you would the divs to flow horizontally you need to float them and assign the display attribute
something like this should do it

#div-container{
width:
}
#div1{
float:left;
width:
height:
}
#div2{
float:left;
display:inline;
}
#div3{
float:left;
display:inline;
}
etc....
 
Ok so i had a play around and come up with Horizontal test ...
But its scrolling verticaly instead of horizontaly and if you lookw hen you scroll, I have my first content box BEHIND my sidebar nav.

I want the header, sidebar and ooter fixed where they are and the content DIVs to scroll horizontaly.

I know I am probably missing something simple but please help :(
 
Back
Top