Can position:fixed be positioned relative to the parent element without setting top and left?

when I was looking at the layout of other people"s blogs, I found an interesting problem. Its sidebar was positioned with position:fixed, but it did not set the values of top and left. At this time, it was not positioned relative to the viewport, but relative to its parent element. I was very confused. I wonder if this usage is correct? And why is position:fixed doing this?

blog address

Jul.08,2022
The

location is called static position, which is where it was before it left the document stream. This will be used as the default value when no positioning is set.


if top left is not set, you can use margin positioning relative to the parent element, and the padding of the parent element is also useful, except that the element is detached from the document stream

  

absolute positioning, when left,top and other attributes are not set, it will be followed by the content of the parent element

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bdc694-396b2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bdc694-396b2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?