Question about the layout of my website
Hi, how can i make the search results not push down the main hero? and also is centering the main hero with an height using VH ok?
codepen: https://codepen.io/Gabriele888/pen/MYKZjYY
9 Replies
you can stop it by adding
position: absolute to the parent with the results
you might have to manually set the width to 100%
and to the parent of the results and the search input, add position: relativeis this the only way?
because someone told me its bad practice to use absolute and relative but maybe he meant just in another context
so im just asking you
using floats for layouts is a very bad practice, but using floats to make the text surround an image isnt
each tool has it's correct use
and this is, in my opinion, the currect use for `position: absolute
ok and what about how the hero is centered, is setting an height with VH ok?
i wouldnt
if i rotate my phone, the height may go below 0
so margin top and setting it manually is better?
have you considered other options, like setting a min-height and margin auto?
not at all, which one would you use?
i thought min height is mostly for containers and margin no idea
container i mean you have something inside
try it, it should work