I’m trying to create nested list:
<html>
<head>
<style>
ol li {
list-style: decimal outside none;
}
</style>
</head>
<body>
<ol>
<li>Digit</li>
<ul>
<li>Circle</li>
</ul>
<li>Digit</li>
</ol>
</body>
</html>
But what I get is:
1. Digit
1. Circle
2. Digit
Why I’m getting a “decimal” marker in unordered list? I think I apply “decimal” only to ol li elements, not ul li.
The selector says “An li that is a descendent of an ol”
The li containing “Circle” is the grandchild of the ol, so it is a descendent.
(It shouldn’t be a grandchild since the only permitted child elements of an
olarelis, so theulshould be inside anli(which would still make it a great-grandchild) or not inside theolat all).You might want to use the child selector
>instead of the descendent selector (a space)