Home > database >  Can't change the list-style-type of a ::marker
Can't change the list-style-type of a ::marker

Time:03-11

Switching out the list-style-type doesn't seem to do anything for a ul li ul li. Not sure if it's possible.

https://jsfiddle.net/swfkmo9t/

<ul>
<li>
  <ul>
  <li>this is a test</li>
  </ul>
</li>
</ul>

ul li ul li::marker{
  list-style-type: square;
}

CodePudding user response:

::marker is a pseudo with a limited set of properties, not an element with list-style property. Use simply ul li ul li {
Read more on: ::marker - Allowable Properties

ul li ul li {
  list-style: square;
}

ul li ul li::marker {
  color: red;
}
<ul>
  <li>
    <ul>
      <li>this is a test</li>
    </ul>
  </li>
</ul>

CodePudding user response:

The problem in your css is don't give list-style-type property to ::marker. Give the list-style-type property to the li tag.

ul li ul li{
  list-style-type: square;
}
<ul>
<li>
  <ul>
  <li>this is a test</li>
  </ul>
</li>
</ul>

  •  Tags:  
  • css
  • Related