Hello, im wanting to place two divs side by side, horizontally, but its not working for me. For some reason, the second div just sits below the first.
A
. 5. B div>. 6.
. 7. . 8. display: inline-block
.The two elements are side-by-side just as I intended and fill the entire width of the parent (which, in this case, is the same as the width of
Dec 7, 2020 div, span { display: inline-block; }. What inline-block does is place elements side by side (like inline elements) We can also assign width and
dear Matthew You assigned float:right in second class, I think that is the problem use padding options .class1 { float:left; border-right:2px solid #000;
To get two divs side by side, you can put them in left/right floating divs: Expand ▽ Copy Code.