first, NO: Using .div1 *
will eventually bite you in the ass.
Best would be to apply the style to .div1 {...}
and rely on the inheritance.
If you have like text in div1, that you don't want to style you may want to apply the style to the (direct) child-nodes of div1: .div1 > * {...}
. And rely from this point on, on the inheritance.
Anything more specific like the example proposed on top will have unexpected side-effects and will drive you onto a way where you will have to increase the Specificity of your selectors more and more.
Leading to things like .div1 p ul li .foo div span.bar {...}
and overriding it with .div1 p ul li .foo div span.bar * {...}
and so on. (dramatized)
If your problem are the links in your markup, you shoold consider a generic "reset"/modification of the link-tags so that they fit better into the surrounding text: sth. like.
a,
a:active {
color: inherit;
}
and maybe you want to restrict even this to a specific context, like .main
Edit:
OK, P.Lionel, that is a different thing; I agree.
Using .someSliderPluginClassName * { box-sizing: border-box }
is an appropriate way to implement this fast and easy, and it has a manageable amount of risk.
You are using .container
(as in your comment) as kind of context for the elements of this slider-plugin and give all control over to this plugin. (Almost) nothing you have to handle/style in this context.
On the other hand, you may consider the migration of your styles to box-sizing: border-box
. Imo. it's the better and more consistent boxing-model, and more and more plugins (and css-frameworks) rely on that.
I know, it's kind of an effort now, but it might pay off in the future. Just my 5 cents.