The ::first-line pseudo-element describes the contents of the first formatted line of an element.
Example – ::first-line
<style>
.box {width: 200px;}
div.box::first-line {
color: red;
}
</style>
<div class="box">
This is sample text where first line will have a different style.
<div>Related
- CSS ::first-letter pseudo element
- CSS ::before and ::after examples
- CSS generated content for ::after and ::before