0

Hi,

I have an elements:

<div id="mydiv" class="mydivclass">

</div>

In CSS i have like:

div#mydiv {
width: 100px;
}
div.mydivclass {
width: 200px;
}

What i want is to the second CSS (class) setting override the first (id) one. The thing is that the class is added dynamically and i want that element to be styled differently if the class is there, however, it is always styled using the id styling property.

Thanks

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Buppy
0

Silly me, !important did the job (just posting if anyone else needs to know this).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.