3 ms·
> That initial value is the same for all elements across the entire web. The initial value of display is inline, and the initial value of every margin property
by pronlover723 4y ago
> That initial value is the same for all elements across the entire web. The initial value of display is inline, and the initial value of every margin property is 0.
What? Pre and H1 do not have an initial margin of 0 and plenty of elements do not have an initial display of inline
Confused.
- masswerk 4y agoThat is before any default or user styles are applied, which are in turn overwritten by author styles. (Think of the default values of a base object or base class, which are then overwritten by the constructor or more specific methods.)
- minitech 4y agoThe three paragraphs that follow explain, including > This is why we need browser styles, which provide different defaults from one element to the next. Some elements should be display: block (divs, paragraphs, lists, headings, etc), and some of those elements should have margins on them to improve readability. If you apply the rule h1 { display: initial; margin: initial; } you’ll get an inline h1 with no margin.
- nightpool 4y agoThis is the difference between the *initial* value, which is the SAME for all elements, and the *default* value, which is based on the user-agent stylesheet. Every property has one single "initial" value, which doesn't change from element to element, but can get overridden by the user-agent for individual elements.