I'm a beginner and I'm trying to fit my header on the top but it's not fitting. Here is screenshot:
Here is my source code:
<header style="height: 50px;background-color: rgb(26, 26, 26);">
<div class="container"></div>
</header>
Can you please let me know, What's wrong here? Help would be appreciated.
To create a fixed top menu, use position:fixed and top:0 .
To fix the position of the header in the webpage, use position: fixed, and to fix it at top use to top:0.
You need to add the following style in your css. There is default styles of browser which needs to overridden, in order to achieve the requirement.
html, body {
margin : 0;
padding : 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With