html - How to give priority between 2 !important -




in order keep css rule want div have add: "padding-left:70px!important" apply generally.

but mobile, padding-left:0px. add media query of mobile size "padding-left:0px!important"

so thought automatically when switching mobile size take css style inside media query 1 use both have!important. not happen, still keeps 75px padding.

thanks

css styles take most specific rule supply, make sure padding-left:0px!important rule still more specific 1 declaring padding-left:70px!important.

if specificity identical, css use last rule defined, ensure mobile override appears after initial padding-left rule.

this can check , understand specificity: https://www.w3.org/tr/css3-selectors/#specificity

bonus: calculate selector specificity: https://specificity.keegan.st/





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -