Forum Moderators: not2easy

Message Too Old, No Replies

div alignment with no floats

side by side div alignment with no floats

         

zackelliott

10:34 pm on May 28, 2009 (gmt 0)

10+ Year Member



Hello,
Is there any way to get 2 divs aligned horizontally without using floats?

rocknbil

11:50 pm on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard zackelliott, you could set the display to inline for this div class, but it has an interesting side effect. Note it won't react to width properties as an inline element.

zackelliott

12:51 am on May 29, 2009 (gmt 0)

10+ Year Member



I have already found that setting the display to inline and floating the divs works quite well but it is covering up my sticky footer. When i just have the display set to inline without the floats it comes out all weird and screwed up.

CSS_Kidd

12:32 pm on May 29, 2009 (gmt 0)

10+ Year Member



Did you put a "clear float" div in between the two divs and the footer?

swa66

6:05 pm on May 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd try
display:inline-block
Do note that in legacy IE versions, it might need a trigger back to display:inline

Or using positioning (but then positioing somethign under it becomes *very* difficult)

But it's perhaps more interesting to figure out why you don't want floats as I think most disadvantages can be solved.

zackelliott

10:21 pm on May 29, 2009 (gmt 0)

10+ Year Member



alright, thanks guys, i figured it out.