Home > DeveloperSection > Forums > CSS text styling
Ashish Pandey

Total Post:128

Points:898
Posted on    August-19-2013 7:21 AM

 CSS-CSS3 CSS-CSS3 
Ratings:


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

Thanks



shreesh chandra shukla
shreesh chandra shukla

Total Post:105

Points:735
Posted on    August-19-2013 8:14 AM

Hi!

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 {

  font-weight:bold;

  text-decoration: underline;

 }


 


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

Follow MindStick