CPColin
asked on
CSS "list-style-type: initial" rule makes an ordered list use discs
I've got this bit of HTML, adapted from an example on w3schools.com:
Firefox and Chrome both render the list as if I'd specified list-style-type: disc. Shouldn't the initial value for that rule be list-style-type: upper-roman? Am I misunderstanding how initial works?
<!DOCTYPE html>
<html>
<head>
<title>List Style Test</title>
<style type="text/css">
li
{
list-style-type: initial;
}
</style>
</head>
<body>
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Firefox and Chrome both render the list as if I'd specified list-style-type: disc. Shouldn't the initial value for that rule be list-style-type: upper-roman? Am I misunderstanding how initial works?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In my mind, it should be upper-roman because the ol element has a type="A" attribute.
initial is not supported in IE ergo not overriding.
I would assume the CSS is overriding the tag declaration since that is not css.
I would assume the CSS is overriding the tag declaration since that is not css.
ASKER
Question: "Am I misunderstanding how initial works?"
Answer: "Yes."
Looks like initial grabs the value from the CSS specification, not the browser's defaults, which is not at all what I expected.
Answer: "Yes."
Looks like initial grabs the value from the CSS specification, not the browser's defaults, which is not at all what I expected.
list-style-type: upper-roman will force the use of I, II, III, etc.