I’m using an internal CSS style sheet to define styles for my <ol> and <li> elements. However, for one list which I have, I’d like to use inline styling. I want the list elements to be one color (blue) and the list bullets to be another (red). If I was to use an internal style sheet, the following would accomplish this for the list in question:
<style>ol { list-style-type:upper-roman; color:blue; } ol li span { color: red; } </style> But I can’t figure out how to do this using inline styling. I don’t want to style each <li>. This following works to apply just one color for everything:
<ol list-style-type:upper-roman; style="color:blue;"> <li><span>Apple</span></li> <li><span>Orange<span></li> <li><span>Pear<span></li> <li><span>Grape<span></li> </ol> But I don’t know how to add in the part to the inline styling statement which in the inline style sheet is:
ol li span { color: red; } in order to color the list items different than the bullets, without coding each list item itself.
coloror you need to reverse an inherited value, then you're going to have to apply the style to each and every element the style is supposed to affect.