Forum Moderators: not2easy

Message Too Old, No Replies

Divs positioned next to each other horizontally?

         

Ben878

10:33 pm on Mar 17, 2008 (gmt 0)

10+ Year Member



Hi I am having some trouble I have my div's that wont seem to position themselves next to each other like I want. They just go to the next line down. Is there anyway to position divs horizontally using CSS? I tried using floats but the relative positioned box with height set to 100% no longer worked.

D_Blackwell

10:39 pm on Mar 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you provide enough HTML and CSS to replicate the problem? It will be easier to work with. For example, will the 'relatively positioned box with height set to 100% be needed? Maybe not. If yes, then it may be easier see what is missing - or what doesn't belong.

DrDoc

10:40 pm on Mar 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Did you try just floating the first div?

Xapti

1:00 am on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Floated elements can be both relatively positioned and assigned 100% height. You must explain your problem in more detail.
It is a possibility that they are bumping lines due to margins, padding, or widths which do not allow for more per line, or the more likely situation is that, for whatever reason, you have a clear assigned to your element(s) (clear: both/right/left)

Dave75

4:41 am on Mar 19, 2008 (gmt 0)

10+ Year Member



You can either float the divs left or right, or, display them inline. Divs are block level elements and display as block by default.

div{float:left}
div{float:right}
div{display:inline}