display: inline;
Browser |
|
---|
The display property changes the display type of an element.
When you apply this property to the LI element, the horizontal list can be created.
li {
display: inline;
}
Property | Value | Explanation |
---|---|---|
display | inline | the element is displayed as an inline element |
- box display types
(Other values can be seen)
Example
<html>
<head>
<title>TAG index</title>
<style type="text/css">
li {
display: inline;
margin-right: 20px;
}
</style>
</head>
<body>
<ul>
<li>First</li>
<li>Second</li>
<li>Third</li>
</ul>
</body>
</html>
- Output
-
- First
- Second
- Third