Question
If the position
property has a default static
value which does not need to be specified, why does this value even exist in the first place?
Answer
This value still needs to be specified for two main reasons:
-
Default styles come from the style sheet the browser applied to an HTML document. These default styles within this user agent style sheet still need to be defined.
-
We may need to override the
position
property. For example, say we want an element to haveposition: fixed;
in desktop view but the defaultposition: static;
declaration in mobile view. In this case we may need the override the fixed positioning within a media query.