Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CSS "list-style-type: initial" rule makes an ordered list use discs

Posted on 2014-03-04
5
Medium Priority
?
441 Views
Last Modified: 2014-03-04
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
Comment
Question by:CPColin
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39903989
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
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39903996
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
 
LVL 14

Author Comment

by:CPColin
ID: 39904003
In my mind, it should be upper-roman because the ol element has a type="A" attribute.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39904020
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
 
LVL 14

Author Closing Comment

by:CPColin
ID: 39904303
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question