Is my title incorrectly set at the top of the webpage?

I am a newbie and I try to fit my headline from above, but it does not fit. Here is a screenshot:

enter image description here

Here is my source code:

<header style="height: 50px;background-color: rgb(26, 26, 26);"> <div class="container"></div> </header> 

Could you tell me what is wrong here? Help will be appreciated.

+6
source share
2 answers

You need to add the following style to your css. To achieve this requirement, the default browser styles are used, which must be overridden.

 html, body { margin : 0; padding : 0; } 
+9
source

All browsers have built-in CSS by default, which is why the page does not display correctly. You need to add reset.css http://cssreset.com/

or add css code to disable the default browser behavior, for example:

 /* CSS reset */ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { margin:0; padding:0; } html,body { margin:0; padding:0; } table { border-collapse:collapse; border-spacing:0; } 
+1
source

Source: https://habr.com/ru/post/989595/


All Articles