The most common way to place two divs side by side is by using inline-block css property. The inline-block property on the parent placed the two divs side by side and as this is inline-block the text-align feature worked here just like an inline element does.
you can use flex property for, Display:flex apply flex layout to the flex items or children of the container only. So, the container itself stays a block level element and thus takes up the entire width of the screen. ...
Instead of using float: left; , you can use display: inline-block; and wrap in a container using white-space: nowrap; .
I want to put several div
s next to each other in one row. All div
s have the same height.
Here is how this can be done using float: left
.
Can this be done without using float
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With