3 ms·
> This is the browser's fault for violating the HTML spec. As per the specification, the default font color is complete black and the default background color i
by chriswarbo 8y ago
> This is the browser's fault for violating the HTML spec. As per the specification, the default font color is complete black and the default background color is complete white.
Your claim surprised me so much I went and re-read the latest HTML spec ( https://www.w3.org/TR/html52/rendering.html#rendering https://www.w3.org/TR/html52/rendering.html#rendering ) and it does indeed say:
> The initial value for the color property is expected to be black. The initial value for the background-color property is expected to be transparent. The canvas' background is expected to be white.
The CSS specs ( https://www.w3.org/TR/2018/REC-css-color-3-20180619/ https://www.w3.org/TR/2018/REC-css-color-3-20180619/ and https://www.w3.org/TR/2011/REC-CSS2-20110607/colors.html#q14.0 https://www.w3.org/TR/2011/REC-CSS2-20110607/colors.html#q14... ) say that the initial values depend on the user agent (hence deferring to the above quote):
> Name: color
> Initial: depends on user agent
> 'background-color'
> Initial: transparent
However, is this also the case for form fields? Scanning through the various CSS specs I can't find any mention of form fields (e.g. buttons, text inputs, etc.). The HTML specs don't seem to specify anything w.r.t. styling form fields either.
- jameshart 8y agoHuh, kids today with their modern web standards with their sensible, well specified defaults. In my day, the default background color was #C0C0C0, as is laid down in the Book of Mozilla.