Take for example the overflow property, for which visible
is default.
In CSS, when should I set properties to their default values explicitly (overflow: visible;
) vs setting to initial
, and why? What's the difference?
Take for example the overflow property, for which visible
is default.
In CSS, when should I set properties to their default values explicitly (overflow: visible;
) vs setting to initial
, and why? What's the difference?
Frankly you wouldn't. Initial isn't supported in Internet Explorer (yeah people actually still use that) so using it will probably cause you some cross browser issues.
But if you did, it may be because your debugging some css. Say if you've been mucking around with the parent divs overflow settings and now the child is acting funny so you try setting it to "whatever" the original setting was using overflow:inherit; intending to set an actual value once you have sussed out whats wrong.
https://css-tricks.com/getting-acquainted-with-initial/
Hope this helps.