I'm trying to remove blank spaces between my elements, but whatever I'm trying to do, it doesn't seem to work. Could you guys help me out a bit?
I've tried manually removing margins from headlines, putting everything into "wrapper" class, and editing it in CSS. But none of that seems to be working, only messing up with my code, if so.
Is there something in my code that prevents those solutions from working correctly?
HTML code:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"<
</head>
<body>
<div class="container">
<header>
<h1>My website</h1>
</header>
<nav>
<ul>
<li>Nav1</li>
<li>Nav2</li>
<li>Nav3</li>
<li id="about">About</li>
</ul>
</nav>
<article>
<h1>Welcome!</h1>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</article>
<footer>
Copyright © .com
</footer>
</div>
</body>
</html>
CSS
.container {
width: 1000px;
height: 800px;
border: solid;
border-color: black;
white-space-collapsing: discard;
}
header, footer {
text-align: center;
background: red;
}
nav {
background: blue;
margin: 0;
}
nav ul {
}
nav ul li {
display: inline-table;
padding: 0 60px 0 0;
margin-bottom: 0;
}
#about {
float: right;
}
article {
margin: 0;
background: yellow;
text-align: center;
padding: 0;
}