Lock an Element to its Parent with Absolute Positioning
The next option for the CSSpositionproperty isabsolute, which locks the element in place relative to its parent container. Unlike therelativeposition, this removes the element from the normal flow of the document, so surrounding items ignore it. The CSS offset properties (top or bottom and left or right) are used to adjust the position.
One nuance with absolute positioning is that it will be locked relative to its closestpositionedancestor. If you forget to add a position rule to the parent item, (this is typically done usingposition: relative;), the browser will keep looking up the chain and ultimately default to thebodytag.
Lock the#searchbarelement to the top-right of itssectionparent by declaring itspositionasabsolute. Give ittopandrightoffsets of 50 pixels each.