Is this going to cause me untold grief if I stick it at the top of my stylesheet?
* {position:relative}
Is this going to cause me untold grief if I stick it at the top of my stylesheet?
* {position:relative}
Is this going to cause me untold grief if I stick it at the top of my stylesheet?
Yes. You will not be able to work with absolutely positioned elements any more, for example - the absolute positioning will always be relative to the parent element, which is almost never the desired result.
I could imagine there are even more side-effects field of z-index
settings.
Not a good idea IMO.
And no, position: static
is not deprecated, after all, it is the default setting :)
It's a bad idea imho as it changes the default behaviour of elements without clear indication and it will have unforseen consequences.
If you really want to have most elements positioned relative, you might want to think about just making div and similar relative.
Answering title question:
This is the current CSS 2.1 spec:
http://www.w3.org/TR/CSS2/visuren.html#propdef-position
Accepted values include static
, relative
, absolute
, fixed
and inherit
.
I'm not sure about CSS 3 (it's still work in progress) but they don't seem to mention static
:
http://www.w3.org/Style/CSS/current-work#positioning
Whatever, I wouldn't really care yet :)
Answering body question:
The default is static
so you'd be changing the property for every single item in the page. The best you can achieve is nothing. The worse is that you'll be probably creating weird side effects you won't even notice at first sight.
Also (this is pure speculation on my side), it can't be good for performance. I'm sure rendering engines are optimized for having a majority of static elements.
Good answers all around. I will add:
1) Relatively positioned items can't be floated, which severely limits your ability to build a table-free layout (and to do a lot of other useful things with CSS).
2) Wildcards can cause performance issues when not used carefully. That would probably not be the case in your example, but it's a bad practice to make a habit of.