Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is CSS style specfiied by the "initial" keyword different from the default style?

Tags:

css

I am reading MDN tutorials of CSS inheritance. It says set initial to property reverts the style to the browser's style. I think the browser's style it what it displays with no CSS at all? But it is different. So zero-CSS style is not controlled by the browser?

https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance

enter image description here

like image 700
maki Avatar asked Oct 15 '22 07:10

maki


1 Answers

The initial value reset the style to its very initial state. the blue color of the link is not it's original style, but this style given it from the browser user agent. but the initial reset it to the original color, which it black;

the styles given to <code>a</code> from the <code>browser user-agent</code>

In the image above: The styles given to a from the browser user-agent

like image 116
Yosef Tukachinsky Avatar answered Oct 20 '22 06:10

Yosef Tukachinsky