Absolute positioning is relative to a containing block that provides a positioning context, which defaults to the document.
a) If absolute positioning is relative to the document, can we visualize the starting point of a document as a two-dimensional coordinate system with its origin in the top left corner of a viewport (assuming we scroll the browser up to the top and far left)?
b) Is it safe to assume that the far right of a viewport is considered the far right of a document by the browser? So when the viewport's width is 800px, the document also has a width of 800 pixels, but if we resize the viewport to 400px, then the document's width is also 400 pixels?
In simpler terms, if an element has a width of 3000px, but the viewport is only 400px wide, is 400px still the width of the document, regardless of the element's width being 3000 pixels?
Thank you
EDIT:
Sorry for extending this further:
1)
You can instruct the browser to ignore anything outside the viewport.
a) It seems the overflow property doesn't necessarily determine whether the browser should display scroll bars to view the entire element. Instead, it appears to manage overflowing content within the element's box.
b) Therefore, even if overflow is set to hidden, will the browser still provide horizontal scroll bar if an element has a width of 3000 pixels?
c) Is there another property that dictates whether a horizontal scroll bar should be shown when elements are wider than the viewport?
2)
I'm unsure how this could happen (refer to A).
I cannot confirm, but an element may have had padding and margin properties set to a high value, leading the browser to remove the margins and paddings instead of providing scroll bars.