Solved

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

Posted on 2014-03-04
5
376 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now