Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Logo Positioning… a job for Z-index? Re: Logo Positioning… a job for Z-index?

#69592
Ian G
Participant
"Robskiwarrior" wrote:
I would avoid using negative values on margin and padding like the plague.

If I were you I would z-index it so it floats above the content section below, as you can just add it as the last HTML element in your header and it will be on top of everything anyway. Give your wrapper a position of relative, then position your logo with absolute and then it will not interfere with your other elements.

Hope that makes sense :)

PS: If you don’t want to worry about z-index at all, you can stick your logo right at the end of your HTML just before you close your wrap, make sure your wrap has a position of relative at least and then your logo absolute – it will again ignore everything and float over everything.

Good deal, I was tinkering with the z-index idea but I apparently wasn’t targeting the proper divs for positioning, because I couldn’t get it to work. I’m working from a pre-made starter base template, so I’ll have to dig around a bit more in there to see how they wrapped everything so I can get the position: fixed/relative CSS where it should be to float the logo. I haven’t used z-index before so I wasn’t sure if it wasn’t working because I had the CSS wrong or if I was misunderstanding the function of z-index entirely. Now I know it just me CSS skills that need sharpening. :D

Thanks Robskiwarrior!