CSS ::first-line pseudo element

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>
refresh

Related

Specification

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments