0
How to center Header tag?
I have 1440px window and set max-width = 800px HTML CODE: <header> <h1>Hi Hello!</h1> <div> <ul> <li><a href="#" >Home</a></li> <li><a href="#" >About</a></li> <li><a href="#" >Contact</a></li> </ul> </div> </header> CSS CODE: header { position: fixed; top: 0; width: 100%; max-width: 800px; }
2 Answers
+ 4
Surya Magesh add both rules to header css:
left:50%;
transform:translateX(-50%);
- 1
.header {
Position : absolute;
justify-items : center:
}