问题
I'm trying to set the font size of a table cell, but its not working. I've tried to set size in the css:
.myclass {
font-size: 10px;
}
It didn't work. I tried to change it to a relative size:
.myclass {
font-size: 0.8em;
}
But it didn't worked either. When i looked at the element using google chrome Developer tools, the font-size tag was there, but was striked out and has a yellow exclamation mark next to it. Does anybody know what it means and how can i set the font size ?
回答1:
If you used a more specific selector to set the font before, the less specific selector won't work. Try to begin with general rules and use the specifics after them.
回答2:
Try adding !important
following the declaration of the style. This will override any other styles.
.myclass {
font-size: 0.8em !important;
}
来源:https://stackoverflow.com/questions/7025993/font-size-being-ignored-in-browsers