W3 Mind Logo
Home » Target first letter of an element – CSS3

Target first letter of an element – CSS3

The ::first-letter selector is used to add a style to the first letter of an element.
You guys may have seen something like this on few sites, where the first letter of a main paragraph is larger than the rest of the content.

				
					p::first-letter {
  font-size: 25px;
  color: #8A2BE2;
}
				
			

Example:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur cursus justo erat. Vestibulum neque nulla, hendrerit vitae ipsum aliquam, dignissim ullamcorper tortor. Suspendisse ultricies tortor sed dolor tincidunt euismod. Sed nibh turpis, tincidunt ac massa non, ornare dictum est.

 

About Author
W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
Leave a Reply

Your email address will not be published. Required fields are marked *

How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!