Is position 'initial' cross-browser - css
Asked Answered
D

4

31

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.

Donelson answered 11/3, 2013 at 16:20 Comment(1)
Use inherit. Initial have been used since 2011. IE doesn't support initial.Intrinsic
G
81

The default for position is position: static;

Gaither answered 11/3, 2013 at 16:23 Comment(1)
Just tested replacing the "position: initial;" for "position: static;" and it worked.Stan
R
24

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.

Rattrap answered 11/3, 2013 at 16:24 Comment(4)
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
G
8

Even IE 11 gives me the 'squiggles' for this one. Changing to static gave me the desired behavior.

enter image description here

Chrome actually suggests it as an acceptable property in its dropdown

enter image description here

Greenwell answered 30/6, 2014 at 7:43 Comment(0)
M
0

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.

Mellisamellisent answered 13/7, 2021 at 0:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.