Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

child div are coming below each other even after using inline-block

I have a div with has 100% as it's width. I want to place 3 more div inside it next to each other with same height as parent's height.

But due to some unknown issues I am not able to place it next to each other.

It's is flowing as display:block even through I have given display:inline-block.

What am I doing wrong here?

JSFiddle Code

like image 852
Rehan Avatar asked Oct 28 '25 17:10

Rehan


1 Answers

It's is flowing as display:block even through I have given display:inline-block.

There are a couple of things you can do. Either float each element, you want on the same line, to the left or add display:inline-block;.

Just noticed that you have given display:inline-block; to the parent element not to the child elements. This is why it wasn't working for you.

Float left: https://jsfiddle.net/25brcg9x/1/

Display inline-block: https://jsfiddle.net/beekvang/25brcg9x/2/

like image 128
Arthur Avatar answered Oct 31 '25 07:10

Arthur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!