[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

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?
0
CPColin
Asked:
CPColin
  • 2
  • 2
1 Solution
 
Paul MacDonaldDirector, Information SystemsCommented:
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.
0
 
GaryCommented:
The default is disc and that is what you are setting using initial
Why do you think it should be upper-roman

edit.
I understand the confusion, OL will be styled differently (roman) but setting initial overrides the browser styles and sets it back to disc.
0
 
CPColinSenior Java ArchitectAuthor Commented:
In my mind, it should be upper-roman because the ol element has a type="A" attribute.
0
 
GaryCommented:
initial is not supported in IE ergo not overriding.

I would assume the CSS is overriding the tag declaration since that is not css.
0
 
CPColinSenior Java ArchitectAuthor Commented:
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.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now