• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

DIV Code question


Kevin

Senior Member
#5



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.
 

Harry

Senior Member
#7
Onartis said:



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
 

Kevin

Senior Member
#8
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
 

syrus69

Junior Member
#9
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....
 
#11
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 :(