[whatwg] <reset> element?

Dean Edwards dean at edwards.name
Fri Dec 15 09:08:35 PST 2006

When creating DHTML widgets (e.g. a colour picker) developers have to 
battle the CSS cascade. A widget might be made of various HTML elements 
which inherit style from the page. Sometimes inherited styles can mess 
with the layout of your widget. So we end up coding stuff like this:

#widget div {margin: 0 !important; padding: 0 !important;}
#widget input {border: 0 !important;}

You can't realistically cover all the cases so potentially a new style 
rule can ruin your widget layout completely.

So I'm suggesting a new element: <reset>

This element is in the document flow as normal except that it acts as a 
blank canvas as far as CSS is concerned. Ideally, it should have no 
style at all. Like this:


The <reset> element acts as a container for HTML elements that are not 
included in the CSS cascade. That way we can build and style widgets 
without worrying about the page that will contain them.



More information about the whatwg mailing list