Jump to content

Delete one of two contradicting CSS rules?


pstein

Recommended Posts

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 by pstein
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...