0
How am I suppose to put two <div> next to each other?
8 Réponses
+ 5
You need to set the div's dimensions and use 'float' property :)
+ 2
Floating elements is an alternative way of positioning. No need to use relative nor absolute positioning with it. But, if you use fixed widths for both floated elements and their container, you have to make sure their total width + margins do not ecxeed the container's width.
You can also use 'flex' positioning but only modern browsers support it.
+ 1
Hmm weird, do you use position:relative? Maybe that's reason of overlapping
+ 1
It has to be relative! found it in stackoverflow yesterday. this stuffs are really confusing 😄 tnx Three G
+ 1
use float: left ; in css for first div
+ 1
I think in CSS: display:inline-block
0
tnx, but float makes them overlap 😭
0
yeah ZinC. I needed another div container to achieve my expected result. the link blow has a solution
http://stackoverflow.com/questions/446060/css-two-divs-next-to-each-other
thanks guys