Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-03-04
5
Medium Priority
?
429 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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…

722 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