p::first-line { text-transform: uppercase }

 

https://www.w3.org/TR/css3-selectors/

Note that the length of the first line depends on a number of factors, including the width of the page, the font size, etc.

 

 1 <style>
 2     P::first-line {
 3         text-transform: uppercase;
 4         color: red;
 5     }
 6 </style>
 7 <body>
 8 <P>This is a somewhat long HTML
 9     paragraph that will be broken into several
10     lines. The first line will be identified
11     by a fictional tag sequence. The other lines
12     will be treated as ordinary lines in the
13     paragraph.</P>
14 <P>This is a somewhat long HTML
15     paragraph that will be broken into several
16     lines. The first line will be identified
17     by a fictional tag sequence. The other lines
18     will be treated as ordinary lines in the
19     paragraph.</P>

 

 

https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform

 

 

posted @ 2016-12-24 20:17  papering  阅读(427)  评论(0编辑  收藏  举报