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:

http://developer.yahoo.com/yui/reset/

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.

Thoughts?

-dean

Reply via email to