About user agent stylesheet


#1

Hello,I just have a problem with user agent stylesheet.

In Learn HTML & CSS: Part I- Resetting Defaults, and I can not understand WHY should we do this?
I mean, if we create the style sheet with great effort, why we should reset it to 0??

it looks like....

 *{
     padding:0;
    margin:0; 
    }

ummm, I am a visual designer who star to learning CSS recently, so maybe there is any common sense in code that I don't know...
Please help me.Thanks a lot.


#2

Browsers have what is called a default style sheet, or as named above, user agent style sheet. It defines the default style rules so that HTML will still render in a sensible fashion when there are no other style sheets present. Some elements such as lists have default padding, paragraphs and lists have default margins, and so on.

Rather than lean on those preset style rules, we simply reset them in the DOM. We haven't removed them from the browser built in code base, just the DOM which concerns itself only with the current document in memory. It gives a designer a blank slate on all elements without interference (which force workaround solutions) from any presets.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.