Set the style for first line of P : p.first letter « Tags « HTML / CSS






Set the style for first line of P

    

<html>
<head>
<title>Set the style for first line of <P></title>
<style type="text/css">
  p:first-line {
  font-size: 200%;
  font-weight: bold;
  }
</style>
</head>
<body>
  <h1>Title of Page</h1>
  <p>This is a sample paragraph with a <a href="http://www.java2s.com" class="warning">link</a>. After link. <em class="warning"> in em warning</em>. After em.</p>

</body>
</html>

   
    
    
  








Related examples in the same category

1.p:first-letter font-size: 1.2em;
2.p:first-letter background-color: black;
3.p:first-letter color: white;
4.p:first-line font-weight: bold;
5.p:first-line font-size: 2em;
6.p:first-line background-image: url(http://java2s.com/style/logo.png);
7.p:first-letter font-size:32px;
8.p:first-letter font-weight:bold;
9.p:first-line font-size:18px;
10.p:first-line font-weight:bold;
11.p.className::first-letter
12.p.className::first-line
13.p::first-letter background: darkblue;
14.p::first-letter color: white;
15.p::first-letter font: 55px "Monotype Corsiva";
16.p::first-letter float: left;
17.p::first-letter margin-right: 5px;
18.p::first-line font-weight: bold;
19.p::first-line letter-spacing: 3px;
20.p:first-letter font-size: 200%;
21.p:first-letter font-weight: bold;
22.p:first-line font-size: 200%;
23.p::first-letter background: crimson;
24.p::first-letter color: pink;
25.p:first-letter font-size:32px; font-weight:bold;
26.p:first-child background: moccasin;
27.p:first-child border: 1px solid tan;
28.This paragraph uses the first-letter pseudo-element to change the appearance of the first letter in the paragraph.
29.Sink First Letter of a paragraph
30.p::first-letter font-size: 200%;background-color: lightgray;border: 1px solid black;
31.p::first-letter
32.first line pseudo-class
33.drop caps with p:first-letter
34.p#dropcap:first-letter
35.p#initialcap:first-letter
36.p::first-letter font: 120% "Monotype Corsiva"