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.