My website includes a search field where users can type in their queries. However, I am facing an issue with the autocomplete feature causing layout problems on certain screen sizes.
In order to prevent the autocomplete list from affecting the overall page layout, I have set its position attribute to absolute. Unfortunately, this sometimes results in the autocomplete list extending beyond the boundaries of the HTML element and overlapping with the footer section.
I am aware that using position: absolute removes the element from the normal document flow, but I am looking for a solution to adjust the height of the container element based on the child element with absolute positioning. Is there a CSS technique to achieve this, or do you recommend another approach?