Forums

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

Home Forums CSS Responsive Fixed Header with CSS Reply To: Responsive Fixed Header with CSS

#181088
Paulie_D
Member

You can make it slightly more responsive by giving a width of 100%..with a max-width (again, you’d have to use media queries) and using transform to center it.


#header {
    top: 0px;
    left:50%;
    transform:translateX(-50%);
    position: fixed;
    background-color: grey;
    width:100%;
    max-width: 640px;
    z-index: 1;
    text-align: center;
    display: block;    
}

http://jsfiddle.net/yrbvw473/6/