I have a css conflict, so I have to go against an absolute positioning property that deals with some class .myclass
. But in one case, I want a div with .myclass
class to have a no absolute positioning. So I put position: initial
, which works in Chrome, but is it cross-browser? I googled it and found nothing really precise.
Is position 'initial' cross-browser - css
Asked Answered
Use inherit. Initial have been used since 2011. IE doesn't support initial. –
Intrinsic
The default for position is position: static;
Just tested replacing the "position: initial;" for "position: static;" and it worked. –
Stan
The initial
keyword was introduced in 2011 in the Cascading and Inheritance Module -- it's supported in FF 19+, Chrome, Safari, Opera 15+ but is currently not supported in any version of IE.
Ah, it is a new generic keyword, that explains why it wasn't listed in the css positioning spec (that spec, I assume, hasn't been updated since it was added) –
Lazybones
@Quentin: It says "Initial: static" in its propdef. The term "initial value" has been in use since CSS1 to mean something like "the spec default value for this property if unspecified." –
Quinones
@Quinones — This answer, while describing the right thing, linked to the wrong thing. I followed links to find it, but it is talking about the
initial
keyword not the initial value. I've edited the answer to point to the correct place. –
Lazybones @Quentin: I know - I'm simply stating that the keyword was introduced to allow access to the long-existent concept of an initial value. –
Quinones
Even IE 11 gives me the 'squiggles' for this one. Changing to static
gave me the desired behavior.
Chrome actually suggests it as an acceptable property in its dropdown
I was having the same issue as position: unset;
wasn't working for me in IE. I changed position: static;
and it worked as expected as IE doesn't have unset behavior.
© 2022 - 2024 — McMap. All rights reserved.