Search for: Search Fixed header Viewing 5 posts - 1 through 5 (of 5 total) March 7, 2014 at 2:22 am March 7, 2014 #17739 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 π March 8, 2014 at 7:33 pm March 8, 2014 #17751 Daniel TaraKeymaster Try this code: #wrapper { margin-top: 204px; } #header { position: fixed; top: 0; z-index: 3; max-width: 1140px; width: 100%; background: #fff; } March 8, 2014 at 9:36 pm March 8, 2014 #17758 PLSantaCroceParticipant Perfect, 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. March 13, 2014 at 12:15 am March 13, 2014 #17790 PLSantaCroceParticipant I 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… March 13, 2014 at 9:08 pm March 13, 2014 #17797 Daniel TaraKeymaster Could you link to an example? Viewing 5 posts - 1 through 5 (of 5 total) Tagged: css, fixed header You must be logged in to reply to this topic.