Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styling individual letters in word

I' currently trying to Style the word "Siteripe". I'd like each letter to have a different color. As shown on this page I'm able to style just the first letter with the lines of CSS code below

#namer:first-letter {
  color:#09C;
  font-size:1.1em;
  font-weight:bold;
}

Since there eight(8) letters in the word, how do I style the remaining seven? I did try the styling bellow but it didn't work. Is there a way to Style the letters individually without wrapping each letter using spans.

   #namer:(1)-letter {
      color:#09C;
      font-size:1.1em;
      font-weight:bold;
    }
like image 581
Dz.slick Avatar asked Aug 11 '12 23:08

Dz.slick


1 Answers

Remember, CSS is Cascading. You can style the whole #namer element separately from the first letter - the more specific style will override the more general one.

#namer:first-letter {
    color:#09C;
    font-size:1.1em;
    font-weight:bold;
}

#namer {
    color:red;
}

Update:

Lettering.js allows for styling individual letters. See the comments below for additional information. The info above is for styling the initial character only, and was in answer to the OP's original question before it was edited to make it clearer.

like image 93
Dave R. Avatar answered Nov 08 '22 06:11

Dave R.