Selects first line of the targeted block level element. This pseudo element does not apply on inline elements.
Example: Apply ::first-line pseudo element on P element.
<!DOCTYPE html>
<html>
<head>
<title>CSS Pseudo Elements - ::first-line</title>
<style>
p, span{
width: 300px;
}
p:first-line {
color: red;
}
span:first-line {
color:blue;
}
</style>
</head>
<body>
<div>
<p>
Block level element(P): Message1............... Message2.............. Message3............
</p>
<span>
Inline element(SPAN): Message1............... Message2.............. Message3............
</span>
</div>
</body>
</html>
Result:
In the above example,
Note:Width property is also not applicable to inline element.