How to prevent linebreak after with div with CSS?

Spread the love

Sometimes, we want to prevent linebreak after with div with CSS.

In this article, we’ll look at how to prevent linebreak after with div with CSS.

How to prevent linebreak after with div with CSS?

To prevent linebreak after with div with CSS, we can make it display inline or inline-block.

For instance, we write

div {
  display: inline;
}

or

div {
  display: inline-block;
}

to make the div display as an inline or inline block eleemnt to stop it from taking the whole row.

Conclusion

To prevent linebreak after with div with CSS, we can make it display inline or inline-block.

Leave a Reply

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