Home > DeveloperSection > Forums > CSS text styling
Ashish Pandey

Total Post:128

Posted on    August-19-2013 7:21 AM


 1 Reply(s)
 1376  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? 


shreesh chandra shukla
shreesh chandra shukla

Total Post:105

Posted on    August-19-2013 8:14 AM


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;



Don't want to miss updates? Please click the below button!

Follow MindStick