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:
xxxxxxxxxx
1
div {
2
display: inline;
3
}
Note:
You can also use
<span>
instead of<div>
tag which isinline
by default.
In this section, we present a practical example of how to convert div to an inline element using CSS.
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
div {
6
display: inline;
7
border: 1px solid black;
8
}
9
</style>
10
</head>
11
<body>
12
<div>The first div element.</div>
13
<div>The second div element.</div>
14
<div>The third div element.</div>
15
</body>
16
</html>