Question:
How can I have two 'div's sitting side by side?
Smoothie
2008-04-09 05:19:47 UTC
Is it possible with css and without tables?

I have tried to use "display: inline" on the div tag itself, but that seems to give me more problems than it solves. Thanks in advance!
Four answers:
J P
2008-04-09 07:01:12 UTC
You can use absolute positioning to do it without floats, but that is really much more difficult and not as flexible.
Navneet Brar
2008-04-09 05:31:12 UTC
Yes you can place two divs side by side. E.g.:







1




2








Above code will help you to do this.



Gud Luck :-)
Erika
2016-10-18 08:16:41 UTC
div works like

in that it creates a sparkling line formerly and after it is named a block show type. you may set the show type to inline (which does no longer create new lines) on your css via utilising "show: inline;"

dkm2006
2008-04-09 05:25:46 UTC
use {float: left;} for both divs


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...