Inline-block not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Inline-block not working

Hi I want four columns that completely cover the page. I thought if I put four diva In div container and made them all inline block this would work if I put the width at 25 percent for each div element. But they just stack. How can I make them side by side? Without using flex or grid. Thanks. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> div { Width:auto; background-color: red; color: yellow; Display: inline-block; } </style> </head> <body> <div> <div style="background-color: black;" width="50%">これ </div> <div width="40%" >なに</div> </div> </body> </html>

12th Aug 2019, 3:53 PM
jun in
4 Answers
+ 3
Set the columns property to float.
12th Aug 2019, 4:01 PM
Anna/Аня
Anna/Аня - avatar
0
Don't know what you mean
12th Aug 2019, 4:02 PM
jun in
0
I'm sure you don't need the float
12th Aug 2019, 4:02 PM
jun in
0
I tried to put columns: float; and it didn't do anything in the div class
12th Aug 2019, 4:04 PM
jun in