Add background to first letter of a row of text for div with :first-letter - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Add background to first letter of a row of text for div 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">
div:first-letter {
   padding:0 4px;
   background:Chartreuse;
}
</style> <!--from w  w w.  j a  va2s  . co  m-->
 </head> 
 <body> 
  <div>
    Style Here 
  </div>  
 </body>
</html>

Related Tutorials