Position for all screen sizes


This is my clone of google homepage
I have positioned the mic in the search bar using absolute positioning, but I checked it on other screens, it doesn’t stay at the same place, how do I go about it ?



Put the search bar and the mic together in a div make the div position: relative and the mic position: absolute. That way the mic will be positioned according to the div position and won’t move when you resize the screen.
When you make an element’s position absolute, it’s positioned absolute to the first parent element with ‘position’ different than the default one or the body(what is your case) if there is none.