ძიება მხარდაჭერაში

ნუ გაებმებით თაღლითების მახეში მხარდაჭერის საიტზე. აქ არასდროს მოგთხოვენ სატელეფონო ნომერზე დარეკვას, შეტყობინების გამოგზავნას ან პირადი მონაცემების გაზიარებას. გთხოვთ, გვაცნობოთ რამე საეჭვოს შემჩნევისას „დარღვევაზე მოხსენების“ მეშვეობით.

ვრცლად

Why inline css property with !important not override the class property in firefox ?

  • 4 პასუხი
  • 1 მომხმარებელი წააწყდა მსგავს სიძნელეს
  • 2 ნახვა
  • ბოლოს გამოეხმაურა cor-el

Why inline css property with !important not override the class property in firefox ?

We try to replicate the same thing in Chrome and there it overrides correctly but in firefox it shows problem

Let me try to clear the scenario

we have a class

.top-container { display: none !important }

and on element we add style

element.style. display = 'block !important;'

but it don't show the element. While in Chrome (OS MAC) it work fine

My System Configuration

OS - MAC

Firefox Version - Firefox 59.0.2.dmg

There is some issue in attaching snapshot. So I put a stackoverflow link where snapshots are present. Please have a look

https://stackoverflow.com/questions/49760154/is-there-anyway-that-inline-css-property-with-important-not-override-the-class

Why inline css property with !important not override the class property in firefox ? We try to replicate the same thing in Chrome and there it overrides correctly but in firefox it shows problem Let me try to clear the scenario we have a class .top-container { display: none !important } and on element we add style element.style. display = 'block !important;' but it don't show the element. While in Chrome (OS MAC) it work fine My System Configuration OS - MAC Firefox Version - Firefox 59.0.2.dmg There is some issue in attaching snapshot. So I put a stackoverflow link where snapshots are present. Please have a look https://stackoverflow.com/questions/49760154/is-there-anyway-that-inline-css-property-with-important-not-override-the-class

ყველა პასუხი (4)

Please always check your code with upload or direct URL link with W3C.org (World Wide Web Consortium) in charge of standards and practices and future development of web pages and web browsers make the rules on code. Mozilla Firefox follows these rules. W3C.org Who make the rules for web code. HTML https://validator.w3.org/ CSS https://jigsaw.w3.org/css-validator/ and https://validator.w3.org/i18n-checker/ and http://mobile.css-validator.org/

Hi , I read those rules that's why I am asking why it behave differently.

Is there any bug in firefox, may be due to long selector ? 

If you need more details to reproduce this bug please let me know

ჩასწორების თარიღი: , ავტორი: abhaygarg12493

Hi if you have the page up and running some where please supply the URL and someone will look at all your code that knows more than I. As the error may not be where you think it is. Meta tag it with No robots, no index and we can see it while others will not.

Staying away from Moz work arounds is always the best.

I will forward this question now as it stands.

Any special reason for using the !important flag since that will possibly makes it less easy to override CSS properties?

The Specificity of a class might be higher than an inline rule and you may not be able to override it..