How do I put the div at the top of the page, playing right at the top

2

Well, I have the following code:

<style>
body{
background-image: url("imagens/fundo.png");
background-repeat: no-repeat;
background-size: cover;
}   


.logo{
margin-left:10%;    

}

.linha1{
margin-left:20%;
background-color:#ABABAB;   
height:5%;
width:20%;
margin-top:0%;
}

.online{
margin-left:60%;
margin-top:1%;
}

.jack1{
background-color:#ABABAB;   
height:5%;
width:20%;
margin-left:10%;
}

</style>
<header>
<div class="jack1">


</div>


<div class="online">
<span style="color:#a9a9a9; font-family:proxima_nova_cn_rgregular,sans-serif; font-size:18px; text-transform: uppercase;">Online:</span>
<span style="color:#a9a9a9; font-family:proxima_nova_cn_rgregular,sans-serif; font-size:17px; text-transform: uppercase;"><b>20</b></span>  
</div>





<div class="logo">
<img src="imagens/logo.png">
</div>


</header>

What I want to do is put the div jack1, at the top of the page, playing the same. For what is appearing to me is with a spacing of a few pixels.

How can I do this?

Thank you.

    
asked by anonymous 16.03.2017 / 10:40

1 answer

2

What you have to do is simply put the body with margin: 0; , this by default has a margin of 8px (if I'm not in error):

body{
    background-image: url("imagens/fundo.png");
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0;
}   
    
16.03.2017 / 10:48