블록과 달리 인라인 요소는 같은 줄 자체에서 시작하고 할당된 너비만 사용합니다. 이제 CSS에서 display:인라인 속성 값을 구현하는 예를 살펴보겠습니다 −
예시
이제 예를 살펴보겠습니다 -
<!DOCTYPE html>
<html>
<head>
<style>
span {
background-color: orange;
color: white;
}
p.demo {
display: none;
}
span.demo1 {
display: inline;
}
</style>
</head>
<body>
<h1>Match Details</h1>
<div>
Match will begin at <p class="demo">9AM</p> 10AM on 20th December.
</div>
<div>
Match will end at <span class="demo1">5PM</span> on 20th December.
</div>
</body>
</html> 출력

예시
이제 다른 예를 살펴보겠습니다 -
<!DOCTYPE html>
<html>
<head>
<style>
span#demo {
background-color:orange;
color: white;
display:inline;
}
</style>
</head>
<body>
<h1>Match Details</h1>
<div>
Match will begin at <span id="demo">9AM</span> on 20th December.
</div>
</body>
</html> 출력
