DEV Community

Discussion on: 3 ways to display two divs side by side

Collapse
akash1394 profile image
akash1394

u can actually use display inline-block method, have both the elements as inline-block and vertical-align middle, put some space using margin or put gap:"some value" and voila it would do the trick

as its an interview question, "how to place to divs next to each other withour using flex"

Collapse
dawnind profile image
Mainak Das Author

Yeah that's very common and traditional way. I totally missed that out! 😅
Thank you 😄