CSS text styling

Posted by  Ashish Pandey
 1982  View(s)
Rate this:
Hi !

Is there a way to style the first word in tag differently than the other words in that tag? For example, say I had this snippet of code: 

<h4>Worpress Quick Tip Of The Week</h4> 

Is there way I could style the word "Wordpress" differently than the other words using css? I know I could just put a span with a unique class around the word Wordpress, but is it possible without doing that? 


  1. Re: CSS text styling


    There is no :first-word selector unfortunately. You can take a look at this script though that implements it by adding the firstWord class to, well, the first word.

    span.firstWord {


      text-decoration: underline;