5

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?

Community
  • 1
  • 1
Emanuil Rusev
  • 34,563
  • 55
  • 137
  • 201

2 Answers2

8

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

  • Then why do you ask the question? –  Jun 07 '10 at 16:17
  • Because I'm looking for an answer. Your post is helpful and I appreciate it but it doesn't answer my question. – Emanuil Rusev Jun 07 '10 at 16:21
  • css reset makes more headaches – David Jun 07 '10 at 16:23
  • Without knowing which browser you are using its impossible to answer your question. – Kenneth Cochran Jun 07 '10 at 16:24
  • 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 Jun 07 '10 at 16:25
  • 1
    @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 Jun 07 '10 at 16:40
  • Wow, that may be what you intended to ask but its a stretch to arrive at that from the question you actually wrote. – Kenneth Cochran Jun 07 '10 at 16:41
  • @ANaves The latest revision of the answer of @DA is very satisfactory. @DA Thanks for the link and the great answer! – Emanuil Rusev Jun 07 '10 at 16:50
  • (@Emanuil - my bad, I did not notice he had edited after your comment.) – ANeves Jun 07 '10 at 16:57
0

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

BillThor
  • 7,306
  • 1
  • 26
  • 19