A blog & community for non-professional web designers, programmers, webmasters, and other web savvies.

First-Letter Styling with CSS

July 6, 2009 - 12:00am -- Haily

This CSS styling can be used to change the styles of the first letter of any text container: span, headers, etc.

<style type="text/css">
/*****************
--First-Letter Styling with CSS
--More CSS Scripts at
--http://icecaves.net/tags/css
*****************/
.codetitle {font-family:Verdana, Arial, sans-serif;font-size:14px;color:#333333;font-weight:bold;text-decoration:underline}
.codetitle:first-letter {font-size:16px;color:#0066ff}
</style>
Here are some containers that can be affected by the :first-letter styles:<br>
<p class="codetitle">Paragraphs</p><h2 class="codetitle">Headers</h2><div class="codetitle">Divs</div><br><div class="title">Remember just the first letter.</div>
Code Preview: 
Here are some containers that can be affected by the :first-letter styles:

Paragraphs

Headers

Divs

Remember just the first letter.
Tags: 

Comments

Anna
Anna's picture
Icicle (?)
Elite Yeti (?)
Rank Points: 48 (?)
Age: 17
Posts: 827
Status: Online
WWW

I've always been curious about this, but I never noticed this tutorial on the old IC... :P

--------------------

Yay, Anna!
AnnaNeo

jenny
jenny's picture
Iceberg (?)
Rank Points: 50 (?)
Age: 17
Posts: 856
Status: Online
WWW

It was there, I think, somewhere, hidden.

--------------------

Jenny-Jen-Jen :D
Bloggity: www.windymill.net
Web-Design Portfolio: www.jenny-aster.net

Scarlie
Scarlie's picture
Glacier (?)
Elite Yeti (?)
Rank Points: 104 (?)
Posts: 440
Status: Offline

People need to be very subtle with this trick because I usually see it and it just appears to be so tacky...

--------------------

I'm a jack of all trades in training.

Louise
Louise's picture
Snowball (?)
Rank Points: 6 (?)
Posts: 223
Status: Offline
WWW

I've overused this in the past...not a good look. Like Scarlie said, subtly works best.

--------------------

"Baldrick, have you no idea what 'irony' is?" "Yes, it's like 'goldy' and 'bronzy' only it's made out of iron."

@IceCaves on Twitter

    Stay Connected

    Twitter Facebook Tumblr Google+ Glaciallis Google RSS

    *Follow us on Twitter or Facebook to also follow minor site updates that don't make it to the homepage news.