Link to home
Start Free TrialLog in
Avatar of CPColin
CPColinFlag for United States of America

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:

<!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>

Open in new window


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?
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

list-style-type: initial sets the list type to whatever is default for the browser.  

list-style-type: upper-roman will force the use of I, II, III, etc.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CPColin

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.
Avatar of CPColin

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.