DEV Community

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

akash1394 profile image

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"

dawnind profile image
Mainak Das Author

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