I want to be able to remove, or at least control the size of the gap between <header>
and <main>
. I've seen other people asking very similar questions, and it came down to the margins of the heading they had at the top (h1 or whatever), but I triple checked that mine were set to 0.
I've already tried setting pretty much every margin I could think of to "0.' I also messed around with the paddings a bit. I am very new to HTML and CSS, this being part of an assignment for an introductory course. We're not actually even to this stuff yet, I'm just being an over-achiever.
html {
font-size: 100%;
}
body {
background-color: #6B6B6B;
padding-bottom: 2 em;
}
#container {
background-color: #000075;
color: #BCFFB0;
max-width: 70%;
min-height: 100%;
margin: auto;
border: 3px solid white;
position: relative;
}
container a {
color: #FF8EEE;
}
p,
container a {
font-size: 125%;
}
main {
max-width: 80%;
margin-left: auto;
margin-right: auto;
margin-top: 0%;
}
h1 {
font-size: 250%;
margin-bottom: 0%;
padding-bottom: 0%;
}
h2 {
margin-left: -5%;
font-size: 175%;
margin-top: 0;
padding: 0;
}
header p {
margin-top: 0%;
}
header>* {
max-width: 95%;
margin-left: auto;
margin-top: 0%;
padding: 0;
}
header,
footer {
background-color: #38005E;
color: #00D220;
}
footer {
position: absolute;
bottom: 0;
height: 2 em;
width: 100%;
}
header a,
footer a {
color: #1CFFCC;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #2BFF05;
}
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Lorem Ipsum Dolor Sit Amet| Home</title>
<link rel="stylesheet" type="text/css" href="styles/style.css">
</head>
<body>
<div id="container">
<header>
<h1> Lorem Ipsum Dolor Sit Amet </h1>
<nav>
<p> <a class="active" href="index.html"> Home</a> | <a href="details.html"> Details</a> | <a href="rsvp.html"> RSVP</a></p>
</nav>
</header>
<main>
<h2> Home </h2>
<p> Cras sem odio, accumsan ut dui a, pretium volutpat ligula.
</p>
</main>
</div>
</body>
` element.) CSS rules with higher specificity should always be preferred over `!important` where possible.