O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Selecting Part of an Element

You can also select just the first letter or first line of an element and then apply formatting to that.

To select the first line of an element

1. Type element, where element is the selector for the element whose first line you’d like to format.

2. Type :first-line to select the entire first line of the element referenced in step 1.

Image There’s no telling which words will be affected by first-line until you view the page in the browser and see how the content flows. It’s not determined by what line the words are on in the HTML itself.

<article class="about">     <h1>Antoni Gaudí</h1>     <p>Many tourists are drawn to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required