CSS: How to Set Background Color for First Letter

Set Background Color for First Letter of a Word or Paragraph

The below CSS style sheet is to set desired Background Color for First Letter of a Word or Paragraph. This style sheet will allow you to set font size, background color, text color

CSS Style Sheet for Set First Letter Background Color


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Set Background Color to First Letter</title>
<style type="text/css">
p:first-letter {
font-size: 5.5em;
background-color: pink;
color: black;
}
</style>
</head>

<body>
<p>This is a example. This is a example. This is a example. This is a example.
This is a example. This is a example. This is a example. This is a example.
This is a example. This is a example. This is a example. This is a example.
This is a example. This is a example. This is a example. </p>
</body>
</html>


Related Topic How to Change font color in Linux terminal window
Convert Image File to Bufferedimage
How to Set Image on Button in HTML
Change Table Row Background color on mouseover
Change Text Selection Color in CSS
CSS  web design  HTML  

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback