CSS类选择器不改变任何东西 [英] CSS class selectors not changing anything
问题描述
我的CSS有问题。它应该设置一个div的颜色与类(倒计时),但文本的颜色不变。我试过许多修复,但不能得到它的工作。这里是相关的CSS:
I'm having problems with my CSS. It should set the colour of a div with a class (for a countdown), but the colour of the text isn't changing. I've tried numerous fixes, but can't get it working. Here is the relevant CSS:
.10seconds, .9seconds, .8seconds, .7seconds, .6seconds { color: #00b200 ;}
.5seconds { color: #ADFF2F ;}
.4seconds { color: #E5E500 ;}
.3seconds { color: #FFA500 ;}
.2seconds { color: #FF5719 ;}
.1seconds { color: #FF0000;}
<div id='timer' class='10seconds'>10</div>
#timer
CSS文件。完整这里的CSS 。
#timer
has no set rules in my CSS file. Full CSS here.
感谢。
推荐答案
这是因为你的类名以number开头,这是CSS不允许的。还原名称和编号,例如:
It's because your class names begin with number, which is not allowed in CSS. Revert the name and number, eg:
.sec5{
color: green;
}
<div class="sec5"> 5 sec </div>
=http://stackoverflow.com/questions/448981/which-characters-are-valid-in-css-class-names-selectors>问题它很好地解释了CSS类名称
Look at this question it is well explained about CSS class names
这篇关于CSS类选择器不改变任何东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!