I'm a beginner in development with HTML and CSS, and I'm having a hard time understanding why html tags are a space. As in the following example where I have a header, a div and a footer with different colors for easy visualization, and between them is always a white line. In such cases would I have to work with negative margin to fix this?
body{
margin: 0;
}
header {
background-color: #333333;
color: white;
}
div {
background-color: red;
}
footer {
background-color: #000000;
color: white;
}
<header class="top-header">
<h1>Header</h1>
</header>
<div class="top-content">
<h1>Main Content</h1>
</div>
<footer>
<h1>Teste</h1>
</footer>