DCSIMG
CSS Tip for highlight all first letters - Pini Dayan

Pini Dayan

The best thing about a boolean is even if you are wrong, you are only off by a bit.

CSS Tip for highlight all first letters

Ever wanted to highlight all the first letters of your paragraphs? Instead of getting angry on your employees and spending time on editing your mark up, here is a simple solution using a special CSS selector called: Pseudo selector. (There are many of them).

So, lets see a simple sample: Say you have some div's in your aspx,ascx, html file and you want all the first letters to be highlighted.

<div>
  This is some paragraph containing some text.....<br />
  this is some paragraph containing some text.....<br />
  this is some paragraph containing some text.....<br />
  this is some paragraph containing some text.....<br />        
</div>

In order to make the first letter highlighted, I will use a type element selector in this case (That matches all the elements with the selector type), You can choose to use any other selector as well.

<style>
   div:first-letter
   {   
      font-size: 200%;
      font-weight: bold;
   }
</style>

And here is the output:

image

 
 
Enjoy
 
Posted: Apr 06 2009, 12:13 PM by Pini Dayan | with 3 comment(s) |
תגים:, ,

Comments

Shlomo said:

Very nice

# April 6, 2009 2:03 PM

CSS Tip for highlight all first letters - Pini Dayan | Best Web Gallery said:

Pingback from  CSS Tip for highlight all first letters - Pini Dayan | Best Web Gallery

# April 6, 2009 4:31 PM

Diafimpumesam said:

In it something is. Many thanks for an explanation, now I will know.

# July 11, 2009 8:42 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: