pstein Posted August 21, 2019 Share Posted August 21, 2019 (edited) In a webpage I have the following HTML code: <img class="logo" src=....>...</img> with the corresponding CSS: .logo { width: 12rem; .... } img { width: auto !important; ... } As you can see there are two somehow contradicting width values. Ok, since the width in IMG has an !important postfix it has a higher priority. And this is the problem. How can I disable the width value/key in IMG CSS specification and let the width value for .logo become active? How can I delete a CSS key? Since "auto" is already the default value overwriting it with the default value makes no sense. I have no access to the original html/CSS code but must apply it afterwards Thank you Peter Edited August 21, 2019 by pstein Link to comment Share on other sites More sharing options...
dsonesuk Posted August 21, 2019 Share Posted August 21, 2019 Its the wrong way round, img selector top that becomes default (without !important), .logo below will make it have precedence over just img selector. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now