htmlcssnormalize-css

normalize css prevents style for single li


I am using a css reset, but ther is one list I want to have a list-style-type. How can I do this, the normalize is always reseting my styles.

js fiddel code

at the end of the css, I'm trying to style the list by class, but is does not work.

HTML

    <ul class="disc">
                        <li>You can draw!</li>
                        <li>You can drag&drop Images!</li>
                        <li>You can add text labels!</li>
                    </ul>

css

.disc:li{
    list-style-type: disc;
}

.disc:ul{
    list-style-type: disc;
}

Solution

  • You need to restore the original padding as well for those markers to show. For example:

    ul.disc {
        list-style: disc;
        padding-left: 40px;
    }
    

    Fiddle.

    This rule will be applied independent of whether reset rules are applied above or below it, as it's more specific (element selector + class) than reset ones (which never have classes, only element selectors + attribute selectors).