When it comes to positioning in CSS, there are a couple of things to consider.
Firstly, with the use of absolute, specifying right:33px;
will create space between the right side of the div and its parent's right side. Is there a way to dictate which side the space should be placed? Can we tell the browser to create X amount of space between the div's left side and the parent's right side? While this can be achieved using calc()
in future CSS or JavaScript now, is there a CSS-only solution available?
Secondly, when using relative and setting right:33px;
, the element moves as if anchored at x:0, y:0 within itself. Is there a way to position it like absolute, where it uses the parent as a reference point instead of its own position? Perhaps there could be a mode that lies between relative and absolute, allowing the element to position itself relative to its parent while still staying within the flow and maintaining its space.
Summary:
Absolute: Positioned relative to the parent but taken out of the flow.
Relative: Positioned relative to itself, lacking the ability to define a distance relationship between itself and the parent's side. Placement is preserved within the flow.