Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset css styles for only div

Tags:

html

css

Well I have a big html document. And I want to embend control to this document but css styles of this control overlap by styles of big html document. How can I reset all styles for only div (and all nested divs)?

like image 943
Neir0 Avatar asked Nov 29 '11 14:11

Neir0


People also ask

How do I reset CSS styles?

Answer: Use the CSS all Property You can simply use the CSS all property with the value revert to remove the additional author-defined CSS styling for an element (i.e. reset to browser's default CSS styling).

How do I remove a style from a specific element?

removeProperty() method is used to remove a property from a style of an element. The style of the element is selected by going through the styleSheets array and selecting the cssRule. The removeProperty method can then be specified with the property to be removed.

What is a reset selector CSS?

A CSS Reset (or “Reset CSS”) is a short, often compressed (minified) set of CSS rules that resets the styling of all HTML elements to a consistent baseline. In case you didn't know, every browser has its own default 'user agent' stylesheet, that it uses to make unstyled websites appear more legible.

Is CSS Reset still needed?

While websites may not need CSS resets anymore, emails still do. Unfortunately, there's still no universal email development standards (we wish!). That means email clients, apps, and devices each have their own unique way of rendering your email, including adding to or altering your code.


1 Answers

With the Yahoo reset http://yuilibrary.com/yui/docs/cssreset/

There is a "contextual" version which only reset elements which are decendent of .yui3-cssreset

e.g.

<div class="yui3-cssreset">
    <!-- Anything in here would be reset-->
</div>
like image 66
Alex KeySmith Avatar answered Oct 04 '22 00:10

Alex KeySmith