Manish Goyal
Manish Goyal

Reputation: 700

Inline list-style-type on ul is not overriding external style applied on all the ul tag

I know there are many times same question has been asked, but none of them is answering my question

I have following style defined in my external css

ul {list-style: none !important}

now in my html I have defined following

<ul style = "list-style-type:circle><li>hello</li></ul>

but this is not working but why?

Live Website Link

Upvotes: 2

Views: 2386

Answers (4)

Comms
Comms

Reputation: 165

If it doesn't work when doing inline or external CSS then why not either create a new class for ul,li,a or use javascript to change the list styling onload=""

ul {list-style-type:none;}
<ul><li>hello</li></ul>

ul.circle {list-style-type:circle;}
<ul class="circle"><li>hello</li></ul>

Upvotes: 0

SAiNT
SAiNT

Reputation: 26

You've really messed up with CSS. using !important is the last resort. I'd advice to fix those things, but if it's not possible, read this article: http://css-tricks.com/specifics-on-css-specificity/

Upvotes: 0

Scott
Scott

Reputation: 2793

You have ul {list-style: none !important} defined at least three times in your CSS. Clean up your code.

Also, this is a terrible use of !important. A global hammer like that will end up needing to be overridden far too many times.

Upvotes: 2

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85575

Try adding body selector body ul{list-style: none !importan;}

Upvotes: 0

Related Questions