Actually, the screenshot itself and the question enter image description here

HTML

<body> <div id="wrapper"> <div id="header" > <img src="img/header3.jpg" class="img_responsive" > </div> <div id="content"> <h1>Откуда этот небольшой отступ сверху?</h1> </div> </div> 

CSS

 *{ margin: 0; padding: 0; } body{ max-width: 100%; line-height: 1.6; font-size: 16px; background-color: #cccccc; } .img_responsive{ display: block; height: auto; max-width: 100%; } #content{ width: 960px; height: 3200px; margin: 0 auto; background-color: #ffffff; } /**************************************************/ /*HEADER*/ /**************************************************/ #header{ position: relative; width: 100%; height: auto; margin: 0 auto; } #sm{ float: left; position: absolute; left: 176px; top: 16px; } #cross{ position: absolute; float: right; top: 116px; right: 176px; } 

    2 answers 2

    In your CSS, in the body tag there is a line-height attribute that sets the leading (line spacing) of the text with a value of 1.6 . Remove this attribute and there will be no space at the top.

    • Removed, the indentation has become less, but it still is - FLWRZ4U
    • @ user207012, If you need to have no indent at all, then add to CSS: h1 {line-height: 0.7;} - Abmin
    • @ user207012, if helped you, mark as the answer - Abmin

    These are the styles that the user-agent puts. In your case, this is the body margin at 8px. To overcome this, there are two options:

    Do not labor:

      body{ margin:0; } 

    Tru: Use the css file to reset all default styles, there are many different ones, you can read and select here.

    • And what to do? How to remove it? - FLWRZ4U
    • Your answer is not correct, check your answer in the code of the person asking the question - Abmin