How to make div elements display inline with CSS?

Spread the love

Sometimes, we want to make div elements display inline with CSS.

In this article, we’ll look at how to make div elements display inline with CSS.

How to make div elements display inline with CSS?

To make div elements display inline with CSS, we set display to inlinbe-block.

For instance, we write

<div>toto</div>
<div>toto</div>
<div>toto</div>

to add a few divs.

Then we write

div {
  display: inline-block;
}

to make the divs display inline with display: inline-block;.

Conclusion

To make div elements display inline with CSS, we set display to inlinbe-block.

Leave a Reply

Your email address will not be published. Required fields are marked *