-
Notifications
You must be signed in to change notification settings - Fork 717
[CSS-22][CSS-21][CSS3] Stacking context complicated #2326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In fact the spec defines
It doesn't mention So I tested a bit and it seems that both Firefox and Chrome create a stacking context, but Edge does not. https://jsfiddle.net/vtxw5us6/ Firefox does it since its initial implementation in bug 886646. See comments 63, 64 and 66. Basically, it seems they just copied webkit, which decided to make |
Hm. I agree that a lot of this problem is the result of the spec being quickly abandoned by its editors. :/ @atanassov, could you help fix this, or find new editors for the spec? |
@tabatkins But you agree that Edge behaves per-spec here, right? |
I think so? I'm not intimately familiar with the organization of the spec, but it does seem like it only specifies that fixpos generates a stacking context from |
Yes, and we should specify that the context is not created for sticky BEFORE the sticky stop to be an experimental. Yes, IE11 also doesn't create stacking context like EDGE for fixed positioned elements. I have more work due to it because I want to put layer between two parts of header, that second part on mobile devices is shown close to bottom edge of phone. Intended: But spec:
On part of websites I also found the sticky also create a stacking context but IMO should not. I mean sticky as "double" relative (relative to scrolling box and parent element) rather than relative/fixed switched.
WUT? |
@Nadya678, as far as I understand, the CSS2.x spec had to change the definition of the The MDN's warning also refers only to the current reality (the fact that most mobile browsers are either WebKit/Blink-based or those that copied the same behavior, while on desktops there are browsers with different behavior like Edge). It doesn't prescribe anything for new browser. And I agree with @Loirooriol and @tabatkins that per current CSS Position Level 3 draft |
But implemented partially in Moz and Cr. And should be specified not to create stacking context and marked with bold. Have we any specification that says the stacking context is not created for sticky? I can file bug but I don't know what specification writes about it. |
Related: #1053 |
Uh oh!
There was an error while loading. Please reload this page.
Why position:fixed and position:sticky create stacking context but the position:relative and absolute don't?
Why the stacking context definition was changed between CSS2.2 and CSS2.1?
This is too complicated for the moment. Many styles with non-default value create stacking context but in many cases stacking context is created only for part of possible values.
BTW. sticky positioning is described on MDN as working similar to relative. If sticky is shown like "fixed" the width is still relative to containing block.
The text was updated successfully, but these errors were encountered: