EN
CSS - convert div to inline element
0
points
In this article, we would like to show you how to convert div to an inline element using CSS.
Quick solution:
div {
display: inline;
}
Note:
You can also use
<span>
instead of<div>
tag which isinline
by default.
Practical example
In this section, we present a practical example of how to convert div to an inline element using CSS.
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
div {
display: inline;
border: 1px solid black;
}
</style>
</head>
<body>
<div>The first div element.</div>
<div>The second div element.</div>
<div>The third div element.</div>
</body>
</html>