tags:

views:

43

answers:

2

Related: How can I locate the default style sheet for a browser?

Most HTML elements have style properties associated with them such a "color", "font-size" and "padding". These style properties have default values. For example the "color" style property associated with the "a" (anchor) element seems to have a default value of "#000066".

What are these values for all the other elements?

+5  A: 

Default values are defined by each browser individually. In many cases they coincide, but sometimes they don't. This is why it is recommended to use "CSS reset" stylesheets to default styles to the same values.

You can find some (unofficial) reference to the default browser styles here:

CSS2.1 User Agent Style Sheet Defaults

Official Mozilla default style sheet

Developer Art
I understand that.
Emanuil
Then why do you ask the question?
Developer Art
Because I'm looking for an answer. Your post is helpful and I appreciate it but it doesn't answer my question.
Emanuil
css reset makes more headaches
Dave
Without knowing which browser you are using its impossible to answer your question.
codeelegance
The question is sensible. It asks, first if those default properties are to some extent defined in the HTML spec (for example, we know that a P element has an implicit margin/padding while a DIV not - is that standarized ? - I guess not). And, second, it asks how one can find that "default style" in each particular browser.
leonbloy
@leonbloy Exactly!
Emanuil
@leonboy and @Emanuil : and then @Developer Art responds that there is no standard (except for *de facto* standards, as is the example OP gives of blue links, that become standards because everyone does the same), and that each browser defines it's own set based on whims or any other justification the team finds appropriate. Then @DA goes further and points a page (User Agent CSS Defaults) with an unofficial but quite extensive list of the styles used by 3 major browsers. What else would you want?
ANeves
+1, despite the absurdity that is recommending CSS resets.
ANeves
Wow, that may be what you intended to ask but its a stretch to arrive at that from the question you actually wrote.
codeelegance
@ANaves The latest revision of the answer of @DA is very satisfactory.@DA Thanks for the link and the great answer!
Emanuil
(@Emanuil - my bad, I did not notice he had edited after your comment.)
ANeves
A: 

The default css styles are wherever the browser programmer chose. There is nothing to prevent them from including the defaults in code.

BillThor