Select the first character with :first-letter - HTML CSS CSS

HTML CSS examples for CSS:Selector

Description

Select the first character with :first-letter

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
p:first-letter<!--from  www.ja va2  s. c  o m-->
 {
   font-weight:bold;
   font-size:301px;
}
</style> 
 </head> 
 <body> 
  <p>Lorem ipsum</p> 
  <!-- h in this example is bold --> 
  <p> <span>L</span>Lorem ipsum d</p> 
  <!-- but why is % and h bold here? --> 
  <!-- is there a way to make only the % bold? -->  
 </body>
</html>

Related Tutorials