re: My Misconceptions about the Universal Selector in CSS VIEW POST

FULL DISCUSSION
 

The universal selector can be very useful if you are creating a 3rd party widget for any other website to use and you don't want their css to affect you. Then you can do something like:

#my-widget > *
{
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    .. etc ..
}

Which can act like css reset just for the elements contained within the widget you are creating.

 

Nice, that's a really good workaround for specificity issues!

code of conduct - report abuse