Viewing 5 posts - 1 through 5 (of 5 total)
-
PLSantaCroceParticipant
Hi folks,
I am trying to make the header and the menu bar fixed, that is, prevent them from scrolling vertically.
Can you guys help me with CSS syntax?
I tried this in custom CSS but didn’t work (layout all messed up)#header {
position: fixed;
border-top:#111 3px solid;
}The website I’m working on is http://www.pasticceria-lio.it/
Any help appreciated π
Daniel TaraKeymasterTry this code:
#wrapper { margin-top: 204px; } #header { position: fixed; top: 0; z-index: 3; max-width: 1140px; width: 100%; background: #fff; }
PLSantaCroceParticipantPerfect, it worked like a charm!
Thanks for taking the time to help out.PS: I modified the margin-top parameter to 172 because my header is narrower.
PLSantaCroceParticipantI just realized that the layout gets messed up on tablets, probably because of the fixed margin-top, right? I don’t know if there is an easy solution…
Viewing 5 posts - 1 through 5 (of 5 total)
Tagged: css, fixed header
You must be logged in to reply to this topic.