Color every character differently

后端 未结 3 901
旧时难觅i
旧时难觅i 2020-12-19 13:30

I am using KK Countdown to countdown to Xmas for a site.

I have a design which I have to follow that has each letter of the day countown with a blue background and b

3条回答
  •  既然无缘
    2020-12-19 14:03

    Assuming you aren't trying to give each letter a different background color, you can just specify CSS for each span like this:

    .kkc-dni {background-color: red;}
    

    Example here: http://jsfiddle.net/jfriend00/WAPds/

    If you want each letter to have a different background color or other unique CSS, then you will have to wrap each letter in its own individual span. You can do that programmatically using JS if you can't control the generated HTML.

提交回复
热议问题