-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
fix: revise information about absolute and fixed #28226
fix: revise information about absolute and fixed #28226
Conversation
Preview URLs (comment last updated: 2023-08-03 06:11:40) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @CBID2 ! Some comments for you to consider.
|
||
This value creates a new [stacking context](/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context) when the value of `z-index` is not `auto`. The margins of absolutely positioned boxes do not [collapse](/en-US/docs/Web/CSS/CSS_box_model/Mastering_margin_collapsing) with other margins. | ||
|
||
- `fixed` | ||
|
||
- : The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its initial [containing block](/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block). Its final position is determined by the values of `top`, `right`, `bottom`, and `left`. | ||
- : The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its viewport [containing block](/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block). Its final position is determined by the values of `top`, `right`, `bottom`, and `left`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence now sounds a bit wrong, due to the position of the link. Maybe say
positioned relative to its containing block, which is the viewport in the case of visual media.
?
@@ -40,13 +40,13 @@ position: unset; | |||
|
|||
- `absolute` | |||
|
|||
- : The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its closest positioned ancestor (if any) or to the initial [containing block](/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block). Its final position is determined by the values of `top`, `right`, `bottom`, and `left`. | |||
- : The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its containing block [containing block](/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block). Its final position is determined by the values of `top`, `right`, `bottom`, and `left`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence now sounds a bit wrong, due to the position of the link, and I also think it just sounds less useful now. The bit about the closest positioned ancestor is not wrong. If anything, the linked page sounds a bit inaccurate to me. If it doesn't have a positioned ancestor, it is positioned relative to the body element, iirc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so do you suggest I remove the linked page @chrisdavidmills?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiya @CBID2! I think what we have here now is OK. I think the fixed
description is improved by the addition you've made, and I think the absolute
description on this page is OK as-is. The linked containing block page might want a little bit of attention, as I described earlier, maybe at a later date.
I committed a couple of small changes directly to your PR, to fix a link that had become broken, and to remove some word duplication.
Thanks for the contribution, much appreciated.
Thank you for your review @chrisdavidmills |
Description
This PR changes the descriptions of the
absolute
andfixed
values in the documentation about the CSSposition
property. It also adds information about the creation of a new stacking context and the behavior of margins for these values.Motivation
This PR aims to help developers gain a clearer understanding of these positioning values.
Additional details
This is the documentation that this PR refers to.
Related issues and pull requests
Fixes #28209