Weird height with div box - html

One of my div is acting weird when I'm testing it in IE.
Here is the picture of it:
image http://img10.imageshack.us/img10/1395/mmmbme.png
The weird thing is that I have height: 1px;. I have no idea of fixing this, I've looked around for a long time for this issue.
Here is my CSS:
body{
background-image: url(images/bakgrund.png);
background-position: center;
background-repeat: no-repeat;
}
#main{
margin: 0px auto;
width: 1870px;
}
#fb{
position: absolute;
height: 69px;
width: 70px;
margin-top: 505px;
margin-left: 790px;
}
#nyheter{
position: absolute;
width: 460px;
height: 210px;
margin-top: 30px;
margin-left: 500px;
}
#nyheter a{
color: white;
}
#nyheter a:hover{
color: #c4c4c4;
}
h4{
font-size: 20px;
color: white;
}
#nyheter p{
margin-top: -25px;
}
h3{
font-weight: 800;
font-size: 20px;
}
#nyheter a:hover{
}
h2{
color: white;
font-family: "Bebas Neue";
font-weight: 400;
font-size: 50px;
position: absolute;
}
#fb:hover
{
}
#twitter a{
}
#twitter{
position: absolute;
height: 69px;
width: 70px;
margin-top: 505;
margin-left: 880px;
}
#banner {
height: 200px;
width: 1000px;
margin-top: -10px;
border: 1px solid transparent;
background-image: url(banner.png);
background-repeat: no-repeat;
background-position: center;
border: thin ridge #3a3a3a;
margin: 0px auto;
margin-left: 450px;
}
/*
#element1{
position: relative;
width: 1000px;
height: 710px;
margin: auto;
background-color: black;
filter:alpha(opacity=85);
-moz-opacity:.85;
opacity:.85;
z-index: 1;
} */
#content1{
width: 1000px;
height: 610px;
color: white;
text-align: left;
font-family: Makisupa;
z-index: 1;
border: thin ridge #3a3a3a;
background-color: black;
float: left;
margin-top: -2px;
margin-left: 450px;
}
#content2{
width: 1000px;
height: 100px;
margin-left: 450px;
position: relative;
color: #a8a8a8;
z-index: 2;
font-family: Arial, Helvetica, sans-serif;
font-size: small;
margin-top: 0.4px;
border: thin ridge #3a3a3a;
background-color: black;
}
#textcontent{
margin-left: 10px;
margin-top: 10px;
position: absolute;
}
#test:hover{
}
#test{
}
#copy{
margin-left: 855px;
margin-top: 60px;
position: absolute;
}
#kodad{
margin-left: 320px;
position: absolute;
margin-top: 70px;
font-size: x-small;
}
a{
text-decoration: none;
color: #a8a8a8;
}
a:hover{
color: white;
}
#textoperation{
margin-top: 15px;
margin-left: 20px;
}
#nyhet{
position: absolute;
font-family: Arial, Helvetica, sans-serif;
color: #bfbfbf;
font-size: 14px;
margin-left: 10px;
margin-top: 50px;
}
#huvudtext{
margin-top: -10px;
}
#rubrik h3{
font-size: 15px;
font-weight: 400;
}
#textinled{
position: absolute;
font-family: Arial, Helvetica, sans-serif;
color: #bfbfbf;
font-size: 15px;
margin-left: 20px;
margin-top: 130px;
}
#video{
position: absolute;
margin-left: 20px;
margin-top: 295px;
}
h2{
color: white;
font-family: "Bebas Neue";
font-weight: 400;
font-size: 40px;
position: absolute;
}
#nyhettext{
position: absolute;
margin-top: -23px;
margin-left: 10px;
}
#huvudtext{
}
#underline{
background-color: #3a3a3a;
position: absolute;
margin-top: 20px;
margin-left: 10px;
position: absolute;
width: 220px;
height: 3px;
}
#mitten{
position: absolute;
height: 570px;
width: 3;
background-color: #3a3a3a;
margin-top: 10px;
margin-left: 470px;
}
/*
#element2{
width: 1000px;
height: 50px;
margin: auto;
margin-top: -671px;
background-color: black;
filter:alpha(opacity=85);
-moz-opacity:.85;
opacity:.85;
z-index: 1;
}
*/
h1{
color: white;
font-family: "Bebas Neue";
font-weight: 400;
font-size: 50px;
position: absolute;
}
#cssmenu{
margin-top: 170px;
}
#cssmenu ul
{
margin: 0;
padding:0;
list-style-type:none;
width:auto;
position:relative;
display:block;
height:30px;
font-size:12px;
font-weight:bold;
background:transparent url(images/nav_bg.png) repeat-x top left;
font-family:Arial, Helvetica, sans-serif;
border-bottom:1px solid #000000;
border-top:1px solid #000000;
}
#cssmenu li
{
display:block;
float:left;
margin:0;
padding:0;
}
#cssmenu li a
{
display:block;
float:left;
color: white;
text-decoration:none;
font-weight:bold;
padding:8px 20px 0 20px;
}
#cssmenu li a:hover
{
color: #c4c4c4;
height:22px;
background:transparent url(images/nav_bg.png) 0px -30px no-repeat;
}
#cssmenu li.active a
{
display:inline;
height:22px;
background:transparent url(images/nav_bg.png) 0px -30px no-repeat;
float:left;
margin:0;
}
Here's my HTML code:
<?xml version="1.0"?>
<! DOCTYPE html PUPLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml/DTD/xhtml1/-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Start </title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<!--[if gte IE 6]>
<link rel="stylesheet" type="text/css" href="nycss.css" />
<![endif]-->
<![if !IE]>
<link rel="stylesheet" type="text/css" href="styles.css" />
<![endif]>
</head>
<body>
<div id="main">
<div id="banner">
<div id='cssmenu'>
<ul>
<li class='active '><a href='#'><span>Hem</span></a></li>
<li><a href='#'><span>Information</span></a></li>
<li><a href='#'><span>Om oss</span></a></li>
<li><a href='#'><span>Anmäla</span></a></li>
<li><a href='#'><span>Partners</span></a></li>
</ul>
</div>
</div>
<!--<div id="element1"></div> -->
<div id="content1">
<div id="background">
</div>
<div id="textoperation"><h1> Operation Pixel 19/02-13 </br>Folkets Hus i Karlshamn </h1></div>
<div id="textinled">
<p> Operation Pixel drivs av fem elever från JB Gymnasiet </br> i Karlshamn som ett projekt arbete. Vi som står för lanet </br> är Adam Erlandsson, Isak Risberg Jönsson, Jonatan Tjärnberg, </br>Victor Johansson och Lucas Mattsson.</p>
<p> Lanet kostar 200 kr och vara mellan 2013.02.19-2013-02.21. </br> Du kan även förhandsboka och betala 150 kr istället.</br> Klicka på Anmäla för att boka din plats. </p>
</div>
<div id="video">
<iframe width="410" height="280" src="http://www.youtube.com/embed/qP40Liau6z4" frameborder="0" allowfullscreen></iframe>
</div>
<div id="mitten"></div>
<div id="nyheter">
<div id="nyhettext"><h2> Nyheter </h2></div>
<div id="underline"></div>
<div id="nyhet">
<h4>Hemsidan är på gång nu</h4><p>Adam Erlandsson håller just nu på att utveckla Operation Pixelshemsida. Hemsidan kommer vara klart inom 1-2 veckor.</br> Mer information kommer inom kort.</p>
<h4> Datum och lokal är bestämd </h4><p> Vi har nu hittat en lokal (folkets hus) och datumet är </br> satt mellan 19/02-13 21/02-13. Lorem ipsum dolor sit amet, consectetur </br>adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </br></br>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate. </p>
<h4> Projekt arbete </h4> <p>ed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem ap
eriam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </br></br> Nemo enim ipsam voluptatem quia volup
tas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
</br></br><h3> Läs alla nyheter </h3>
</div>
</div>
<div id="fb">
<img src="images/fb.png">
</div>
<div id="twitter">
<img src="images/twitter.png">
</div>
</div>
<div id="content2">
<div id="textcontent">
<div id="test"> Hem </br></div>
<div id="test"> Information </br></div>
<div id="test"> Om Oss </br></div>
<div id="test"> Anmäla </br></div>
<div id="test"> Partners </div>
</div>
<div id="kodad">
<p> Code by Adam Erlandsson. Design by Adam Erlandsson & Victor Johansson </p>
</div>
<div id="copy">
<p> © 2012 Operation Pixel </p>
</div>
</div>
</div>
</body>
</html>

To be on the safe side, write a comment into the div and set its font-size and line-height also. In general, all visual styles should be expressed by stylesheets, not by HTML tags. Maybe you better add a CSS border.
#nyhettext h2 {
border-bottom: 3px solid #3a3a3a;
}
Anyway, the following should work with your current approach.
HTML
<div id="underline"><!-- --></div>
CSS
#underline{
background-color: #3a3a3a;
position: absolute;
margin-top: 20px;
margin-left: 10px;
/* position: absolute; */
width: 220px;
height: 3px;
font-size: 1px;
line-height: 1px;
}
One more thing: Do all these elements need to have an id? There should never be more than one element with the same id (see <div id="test">). Consider using class instead.

Related

How do I align images inside of a container that contains a paragraph?

I have put the image inside of the paragraph tag itself and floated it right, however it moves it to the right but underlaps the container edge.
I have taken it out of the paragraph section as well and it still does the same. I have created containers as well for them. I want the image in the container with the paragraph. I have attached an image of the issue I am having as well as my css.
body {
background-image: url(../images/keyboard.jpeg);
background-repeat: no-repeat;
background-size: cover;
font-family: cursive;
}
/* GOOGLE FONTS*/
#import url('https://fonts.googleapis.com/css2?family=Cookie&family=Fuzzy+Bubbles&family=Jost:wght#700&display=swap');
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Cookie';
font-weight: 700;
}
/*ID Classes*/
#mainTitle {
color: #FFF;
font-size: 5em;
text-align: center;
text-shadow: 5px 5px 10px #17e85f;
text-decoration: underline solid;
font-family: fantasy;
}
#container {
border: 10px solid #FFF;
margin: auto;
margin-top: 10px;
padding: auto;
width: 50%;
}
#footer {
color: #FFF;
text-align: center;
border: 2px;
border-style: solid;
}
/* REUSABLE CLASSES*/
.navbar {
background-color: #0a861d;
border-radius: 30px;
text-align: center;
}
.navbar li {
display: inline-block;
list-style: none;
margin: 13px 20px;
text-align: center;
}
.navbar ul {
overflow: auto;
}
.navbar li a {
padding: 3px 3px;
text-decoration: none;
color: white;
}
.search {
float: right;
color: white;
padding: 12px 75px;
}
.navbar input {
border: 2px solid black;
border-radius: 14px;
padding: 3px 17px;
width: 129px;
}
/*SERVICES PAGE LIST*/
.servicelist ul {
line-height: 1.5em;
margin: 5px 0 15px;
padding: 0;
}
.servicelist li {
font-size: 50px;
font-weight: 500;
background-image: linear-gradient(to left, rgba(60, 154, 118, 0.91), #15c723);
color: transparent;
text-align: center;
background-clip: text;
-webkit-background-clip: text;
}
.center {
text-align: center;
}
.margin {
margin-top: 10px;
}
.scontainer {
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.box {
float: left;
width: 50%;
color: #ccc;
text-align: center;
height: 50%;
font-size: 50vmin;
font-family: helvetica;
}
/* SINGLE CLASSES*/
a:hover {
box-shadow: inset 100px 0 0 0 #54b3d6;
color: white;
}
h2 {
color: #FFF;
font-size: 2em;
text-align: center;
text-shadow: 5px 5px 10px #17e85f;
text-decoration: underline solid;
font-family: fantasy;
}
p {
color: #b8dae2;
font-family: 'Helvetica Neue', sans-serif;
font-size: 1.3em;
line-height: 24px;
margin: 10px 10px 24px;
padding: 30px;
text-align: justify;
border: 3px solid #FFF;
}
.service_styling {
color: #b8dae2;
font-family: 'Helvetica Neue', sans-serif;
font-size: 1.3em;
line-height: 24px;
margin: 10px 10px 24px;
padding: 30px;
text-align: justify;
border: 3px solid #FFF;
}
.imgcontainer {
width: auto;
height: auto;
border: 2px solid red;
float: inline-end;
}
.realImgContainer {
width: auto;
height: auto;
border: 2px solid red;
float: right;
}
img {
/* max-width: 50%; */
/* max-height: 50%; */
/* border: 5px solid #FFF; */
/* margin: auto; */
/* margin-top: 10px; */
/* padding: auto; */
/* width: 50%; */
}
/*
.imgHardware{
float: right;
}
.imgSoftware{
float: right;
}
.imgApp{
float: right;
}
.imgCabling{
float: right;
}
*/
<!-- NAV BAR-->
<nav class="navbar">
<ul>
<li>Home</li>
<li>Services</li>
<li>Locations</li>
<div class="search">
<input type="text" name="search" id="search" placeholder="Search this website">
</div>
</ul>
</nav>
<h1 id="mainTitle"> Services</h1>
<!-- MAIN SECTION-->
<section id="container">
<h2> Things We Do </h2>
<div class="servicelist margin">
<h2>Hardware</h2>
<div class="service_styling">
<span>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
<div><img class="realImgContainer" src="images/cpusocket.jpeg" alt="computer socket"></div>
</span>
</div>
<div style="clear:both"></div>
<h2>Software</h2>
<p> We provide the latest software for all kinds of fields. We work directly with vendors to get the best rate - we provide competitive rates and offer affordable and simple subscription solutions - we also carry full version software that is subscription-free.
<img class="imgSoftware" src="images/code.jpeg" alt="computer code"></p>
<h2>Application development</h2>
<p> We can create and deploy custom software for whatever task you need completed. Our seasoned developers specialize in C, C++ and Java. Allowing us to create versailte and flexible software. Our team will with work with you hand in hand to ensure you
get exactly what you need. We will also provide 24/7 maintenance as well as upgrades on all of our in house software.
<img class="imgApp" src="images/codedeveloper.jpeg" alt="someone coding"></p>
<h2>Enterprise cabling</h2>
<p> We have over 30 years of infrastructure cabling experience. We have in house techncians who can terminate and pull ethernet and fiber optic cabling. We use our own equipment and do all of our work in house - without the use of a third party. So we
can give you a fair price as well as a clean and concise debriefing of the exact work we will be doing and its core benefits.
<img class="imgCabling" src="images/switchandcable.jpeg" alt="switch and cable">
</p>
</ul>
</section>
<!-- SUB SECTION-->
<section>
</section>
<!-- FOOTER-->
<div id="footer">© 2050</div>

Why is there padding between my header and body? [duplicate]

This question already has answers here:
CSS margin terror; Margin adds space outside parent element [duplicate]
(7 answers)
Why does this CSS margin-top style not work?
(14 answers)
Closed 4 years ago.
why is there space at the top of my header and above my body?
body {
background-color: #efefef;
font-family: "verdana";
max-width: 1000px;
border: solid #ffffff 3px;
margin: auto;
}
#container {
background-color: #8a8a8a;
}
#header {
background-color: #8a8a8a;
}
h1 {
background-color: #F47D31;
color: #FFFFFF;
text-align: center;
font-family: "verdana";
text-transform: uppercase;
padding: 10px 0 10px 0;
}
h2 {
background-color: #F47D31;
color: #ffffff;
font-family: "verdana";
text-transform: uppercase;
text-align: center;
padding: 10px 0 10px 0;
}
h3 {
background-color: #F47D31;
color: #ffffff;
font-family: "verdana";
text-transform: uppercase;
text-align: center;
padding: 10px 0 10px 0;
}
p {
font-family: "verdana";
line-height: 1.5em;
color: #ffffff;
text-align: justify;
}
#nav {
display: block;
width: 25%;
float: left;
}
#nav ul {
list-style-type: none;
}
#nav a:link, #nav a:visited {
display: block;
border-bottom: 2px solid #fff;
padding: 10px;
text-decoration: none;
font-weight: bold;
margin: 5px;
}
#nav a:hover {
color: white;
background-color: #F47D31;
text-decoration: underline;
}
hr {
border: solid #efefef 1px;
}
table {
padding: 10px;
}
tr:nth-child(even) {
background-color: #E9EAE8;
color: #2a2a2a;
}
tr:nth-child(odd) {
background-color: #ffffff;
color: #2a2a2a;
}
tr:hover {
background-color: #F47D31;
}
#products_list {
list-style: none;
padding: 20px
}
figure {
display: block;
width: 202px;
height: 170px;
float: left;
margin: 10px;
background-color: #e7e3d8;
padding: 9px;
}
figure img {
width: 200px;
height: 150px;
border: 1px solid #d6d6d6;
}
figcaption {
text-align: center;
color: #F47D31;
}
fieldset {
background-color: #f1f1f1;
border: none;
border-radius: 2px;
margin-bottom: 0px;
overflow: hidden;
padding: 0 10px;
}
ul {
background-color: #fff;
border: 1px solid #eaeaea;
list-style: none;
margin: 12px;
padding: 12px;
}
li {
margin: 0.5em 0;
}
label {
display: inline-block;
padding: 3px 6px;
text-align: right;
width: 150px;
vertical-align: top;
}
.paragraph {
padding: 0 10px 0 10px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Innovative Multimedia Seminar 1</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>Hello World</h1>
<h2>Hello World 2</h2>
<h3>Innovative Multimedia Rocks!</h3>
</div>
<div id="container">
<div id="nav">
<!--Add Links Here -->
<ul>
<li> Home Page </li>
<li> Products Page </li>
<li> Register Page </li>
<li> SHU website homepage </li>
</ul>
</div>
<div>
<figure>
<img src="img/image1.jpg" alt="Horses in a field">
<figcaption>
A horse and two foals
</figcaption>
</figure>
<figure>
<img src="img/image2.jpg" alt="Flowers growing">
<figcaption>
Three Flowers Growing
</figcaption>
</figure>
<figure>
<img src="img/image3.jpg" alt="Butterfly on flower">
<figcaption>
Butterfly on flower
</figcaption>
</figure>
<div class="paragraph">
<p>
Lorem ipsum dolor sit amet, oporteat hendrerit id pro. His munere virtute facilis ex. Detracto concludaturque vel ea, quo id iusto deseruisse accommodare. Ea sit habeo audiam concludaturque, an usu vero numquam eruditi. Ex scripta neglegentur pri, timeam
omittam theophrastus ne mel, mea simul perpetua no.
</p>
<hr>
<p>
Vel aliquid fierent te, per quas elaboraret in. Eu mei omittam prodesset, vel liber complectitur concludaturque an. Nihil choro at qui, rebum legendos mei ex, vis ex choro quaeque reprimique. No pri bonorum expetenda liberavisse, sed ut erat senserit.
</p>
<hr>
<p>
No duo habemus vivendum euripidis. Et mutat populo constituto per, veniam populo honestatis sit ex. Propriae lucilius at ius, qui tale invidunt te. In vitae probatus explicari nec, ex prima delenit moderatius sit, putent mentitum gloriatur pro in. Justo
volumus eum an.
</p>
</div>
</div>
</div>
</body>
</html>
Just remove the margin from the h1 by putting margin-top: 0;
h1 {
background-color: #F47D31;
color: #FFFFFF;
text-align: center;
font-family: "verdana";
text-transform: uppercase;
padding: 10px 0 10px 0;
margin-top: 0;
}
Code Pen Example
and I'm not sure what you mean by the body having padding.
As you can see in the h1 breakdown picture, the h1 tag gets its styling from styles.css, and there is padding set to 10 pixels above and under the h1 tag.
So you could try to remove the padding-style from styles.css and see if it removes the space. Or yet easier, just uncheck the checkbox for the padding style in the DevTools shown in the picture.

Trying to create fixed transparent menu but want h1 to be centered for responsive design and .intro to be moved down without making a gap

I am trying to create a fixed nav. For the most part, it works. But I want to center the h1 for responsive design. I could just push it away from the burger menu but then it wouldn't be responsive and bang in the middle.
Also I would like to push the .intro paragraph down away from the top. But every time I do a margin gap appears at the top, and I can't for the life of me remember how to get rid of this.
Thank you to anyone who takes a look. Means a lot! Hopefully one day I can repay the favor!
Below is my HTML and CSS. I also used a standard normalize.css, and some Js but I don't think you will need that. If you do, let me know:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Code Review</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/styles.css">
<link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
</head>
<body>
<header>
<!-- Introduction -->
<div class="background">
<nav class="navbar">
<span class="open-slide" onclick="openSideMenu()">
<!-- <a href="#" onclick="openSideMenu()">-->
<svg width="30" height="30">
<path d="M0,5 30,5" stroke="#000" stroke-width="4"/>
<path d="M0,14 30,14" stroke="#000" stroke-width="4"/>
<path d="M0,23 30,23" stroke="#000" stroke-width="4"/>
</svg>
<!-- </a>-->
</span>
<div id="main">
<h1>Luke Bennett</h1>
</div>
<!--
<ul class="navbar-nav">
<li>Home</li>
<li>About</li>
<li>Portfolio</li>
<li>Resume</li>
<li>Contact</li>
</ul>
-->
</nav>
<!-- Side Navigation Bar -->
<div id="side-menu" class="side-nav">
<span class="btn-close exit" onclick="closeSideMenu()">×</span>
Home
<a onclick="closeSideMenu()" href="#about">About</a>
<a onclick="closeSideMenu()" href="#portfolio-link">Portfolio</a>
<a onclick="closeSideMenu()" href="#resume-link">Resume</a>
<a onclick="closeSideMenu()" href="#contact">Contact</a>
</div>
<p class="intro">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</header>
<main>
<!-- About Me -->
<div class="about-me"><a id="about"></a>
<h2>About Me</h2>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
</div>
<!-- Portfolio -->
<div class="portfolio"><a id="portfolio-link"></a>
<h2>Portfolio</h2>
<!-- Front Page -->
<img src="img/well-being/well-being.png" alt="Donjas-Well-Being-For-Kids"/>
</div>
<!-- Resume -->
<div class="resume">
Download Resume
</div>
<!-- Contact Form -->
<div class="contact-form"><a id="contact"></a>
<form>
<fieldset>
<legend>Contact Form</legend>
<ul>
<li>
<label for="name">Name</label>
<input required type="text" id="name" name="full_name" placeholder="Required">
</li>
<li>
<label for="email">Email</label>
<input required type="text" id="email" name="email_address" placeholder="Required">
</li>
<li>
<label for="message">Message</label>
<textarea id="message" name="other_topics"></textarea>
</li>
<button type="submit">Hello!</button>
</ul>
</fieldset>
</form>
</div>
</main>
<footer>
<p>My name is Luke Bennett and I am a Human - Luke Bennett</p>
</footer>
<script src="javascript/menu.js"></script>
*,
input,
textarea,
button {
font-family: 'Lato', sans-serif;
}
h1 {
font-size: 1.7rem;
font-weight: 300;
letter-spacing: 3px;
}
h2 {
font-size: 1.4rem;
font-weight: 700;
letter-spacing: 2px;
}
p {
letter-spacing: 1px;
}
ul {
list-style: none;
padding: 0;
}
a {
text-decoration: none;
}
/************************************************************
HEADER
*************************************************************/
.navbar {
display: flex;
position: fixed;
overflow: hidden;
height: 40px;
padding: 16px 16px;
align-items: center;
}
#main {
margin: 0 auto;
}
#main a {
color: black;
}
.background {
background: linear-gradient(0deg, #fff, transparent 40%),
#333333 url('../img/sophie.jpg') no-repeat center;
background-size: cover;
padding-bottom: 50%;
margin-bottom: 30px;
}
.intro {
background: white;
opacity: 0.65;
line-height: 40px;
letter-spacing: 4px;
padding: 20px;
margin: 0 15% 15%;
}
/************************************************************
SIDE NAV
*************************************************************/
svg {
padding-top: 3px;
transition: 1s;
/*
border: 1px solid black;
border-radius: 50%;
*/
}
svg:hover {
opacity: 0.3;
}
.side-nav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #333333;
opacity: 0.9;
overflow-x: hidden;
text-align: center;
transition: 0.5s;
padding-top: 90px;
}
.side-nav a,
.btn-close {
display: block;
font-weight: 400;
color: white;
padding: 15px;
transition: 1s;
}
.side-nav a:hover,
.btn-close:hover {
background: white;
color: black;
font-weight: 400;
cursor: pointer;
}
.side-nav .btn-close {
position: absolute;
top: 0;
right: 22px;
font-size: 36px;
margin-left: 50px;
}
/************************************************************
MAIN
*************************************************************/
main {
margin-bottom: 0
}
.about-me {
margin-bottom: 40px;
}
.about-me h2 {
margin-bottom: 30px;
}
.about-me h2,
.about-me p {
text-align: center;
margin-left: 10%;
margin-right: 10%;
}
.about-me p {
font-weight: 300;
margin-bottom: 0px;
}
/************************************************************
PORTFOLIO
*************************************************************/
.portfolio {
background: #DCEAF5;
text-align: center;
padding: 20px 20px 50px;
}
.portfolio h2 {
color: black;
margin-bottom: 40px;
}
.portfolio img {
width: 80%;
padding: 3px;
transition: 1s;
margin-bottom: 10px;
border: 2px solid grey;
}
.portfolio img:hover {
opacity: 0.6;
}
/************************************************************
RESUME
*************************************************************/
/* #DCEAF5 #659EB8 */
.resume {
display: flex;
background: #969DA3;
padding: 10%;
}
.resume a {
display: block;
background: #DCEAF5;
color: black;
font-size: 1.2rem;
text-align: center;
margin: auto;
padding: 7%;
border-radius: 5px;
transition: 0.5s;
}
.resume a:hover {
opacity: 0.6;
}
/************************************************************
CONTACT
*************************************************************/
.contact-form {
background: #cc8c33;
height: 500px;
padding: 20% 10%;
}
fieldset {
border: 0;
}
legend {
font-size: 1.5rem;
font-weight: 400;
text-align: center;
color: white;
}
label {
display: block;
color: white;
margin-bottom: 10px;
}
input,
textarea {
box-sizing: border-box;
border-radius: 5px;
padding: 10px;
}
input:focus,
textarea:focus {
border: 2px solid #969DA3;
outline: none;
}
input {
border-style: none;
width: 100%;
border: 2px solid #cc8c33;
margin-bottom: 10px;
transition: 0.5s;
}
::placeholder {
text-align: right;
font-style: italic;
font-size: 0.7rem;
padding-right: 1px;
}
/* Textarea styling */
textarea {
height: 110px;
resize: none;
width: 100%;
margin-bottom: 30px;
border: 2px solid #cc8c33;
}
/* Button styling */
button {
border: none;
background: lightblue;
color: white;
font-weight: 700;
font-size: 1.1rem;
letter-spacing: 1px;
width: 100%;
border-radius: 5px;
padding: 20px;
transition: 0.5s;
}
button:hover {
background: #DCEAF5;
color: black;
}
/************************************************************
SOCIAL
*************************************************************/
footer {
background: lightblue;
height: 500px;
}

HTML/CSS - 100% Height Not truly 100&

I seem to be constantly running into this problem, and I'm not sure where I'm making the mistake.
I have a main-body div that is holding a background-color that I want as the background of the page. Within the dive I've got a section class with the little sections that are going to be copied over and over again with just the content changed.
If you scroll to the bottom, you'll notice that the background of the main-body div isn't really 100% and leaves this white bar. How might I go about fixing this?
*
{
margin: 0;
padding: 0;
}
#header
{
height: 230px;
width: 100%;
background-color: #0099CC;
display: block;
}
#headerFixedWidth
{
width: 85%;
height: 230px;
//border: 1px solid #ccc;
margin: 0 auto;
}
#nav
{
//border: 1px solid #ccc;
height: 35px;
width: 700px;
margin: 0 auto;
margin-top: 40px;
}
#mainBody
{
background-color: #F1F4F9;
width: 100%;
//height: 100%;
margin-bottom: 30px;
}
.left-content
{
height: 550px;
width: 581px;
background-color: white;
margin-left: 20px;
}
.title
{
font-family: 'Lato', sans-serif;
color: #ccc;
font-size: 37px;
font-weight: bold;
color: #4E5E6A;
margin: 20px 30px;
text-shadow: rgba(78, 94, 106, .2) .1px .1px 2px -1px;
}
.author-subline
{
font-family: 'Lato', sans-serif;
font-size: 18px;
font-weight: bold;
color: #4E5E6A;
margin-top: 20px;
margin-bottom: 10px;
margin-left: 30px;
}
.article-text
{
font-family: 'Lato', sans-serif;
font-size: 17px;
color: #4E5E6A;
margin-top: 20px;
margin-bottom: 10px;
margin-left: 30px;
margin-right: 10px;
line-height: 1.56;
}
.readMore
{
font-family: 'Lato', sans-serif;
font-size: 13px;
color: #4E5E6A;
margin-top: 15px;
margin-bottom: 30px;
margin-left: 30px;
margin-right: 10px;
}
<div id="header">
<div id="headerFixedWidth"></div>
</div>
<div id="mainBody">
<section class="left-content">
<p class="title">Minim perferendis placeat</p>
<p class="author-subline">Minim perferendis placeat modi</p>
<p class="article-text">Minim perferendis placeat modi, vitae porttitor exercitation dolorum duis atque ridiculus luctus earum!.</p>
<p class="readMore">Read More</p>
</section>
<section class="left-content">
<p class="title">Minim perferendis placeat</p>
<p class="author-subline">Minim perferendis placeat modi</p>
<p class="article-text">Minim perferendis placeat modi, vitae porttitor exercitation dolorum duis atque ridiculus luctus earum!.</p>
<p class="readMore">Read More</p>
</section>
<section class="left-content">
<p class="title">Minim perferendis placeat</p>
<p class="author-subline">Minim perferendis placeat modi</p>
<p class="article-text">Minim perferendis placeat modi, vitae porttitor exercitation dolorum duis atque ridiculus luctus earum!.</p>
<p class="readMore">Read More</p>
</section>
<section class="left-content">
<p class="title">Minim perferendis placeat</p>
<p class="author-subline">Minim perferendis placeat modi</p>
<p class="article-text">Minim perferendis placeat modi, vitae porttitor exercitation dolorum duis atque ridiculus luctus earum!.</p>
<p class="readMore">Read More</p>
</section>
</div>
It is because of the #mainBody having a margin:
Just remove the margin-bottom and it will be alright.
#mainBody {
background-color: #F1F4F9;
width: 100%;
margin-bottom: 0; /* Do this... */
}
Yo do not need a margin at the body (I also don´t know why are you using this...):
#mainBody {
background-color: #F1F4F9;
width: 100%;
}
If you just change the #mainBody CSS property margin-bottom you should be fine!
#mainbody{
background-color: #F1F4F9;
width: 100%;
//height: 100%;
margin-bottom: 30px;
}
To this
#mainbody{
background-color: #F1F4F9;
width: 100%;
//height: 100%;
}

Footer is not styling in CSS

I'm making a page layout and I can't apply styles only to the footer for some reason, I've reviewed the code and did find anything wrong (But i'm sure there bc its not working -_-) I've tried rewriting the code and still not working.
//*GENERAL*//
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: sans-serif;
border: 1px solid black;
}
.logo img {
width: 100px;
margin: 50px auto 10px;
display: block;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
a {
text-decoration: none;
color: black;
}
//*NAVIGATION*//
nav ul {
list-style: none;
padding: 0;
margin: 0;
}
nav ul li {
padding: 10px;
text-align: center;
margin: 5px;
}
nav ul li a {
color: black;
}
//*HERO*//
.wrap {
height: 400px;
padding: 1px
}
.head-content {
height: 505px;
background: url(../img/hero.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: 40% 50%;
padding: 10px;
text-align: center;
}
.head-content h1, a {
color: white;
}
.head-content h1 {
margin-top: 130px;
font-size: 3em;
}
.head-content .btn {
padding: 15px 20px;
margin: 10px auto;
background: #FF0080;
border-radius: 3px;
display: inline-block;
border-radius: 5px;
}
.btn:hover {
color: #FF0080;
background: white;
font-weight: bold;
transition: .25s;
}
//*LEARN MORE*//
.wrap-services {
height: 1400px;
padding: 1px;
margin: 1px;
}
.headline {
color: rgba(0,0,0, .8);
text-align: center;
padding: 10px;
height: 100px;
margin: 70px 0 0 0;
}
.headline h2 {
font-size: 1.5em;
padding: 0;
margin: 0;
}
.headline h3 {
color: rgba(0,0,0, .4);
font-weight: lighter;
font-size: 1em;
}
.ser-1,
.ser-2,
.ser-3 {
height: 400px;
padding: 10px;
margin: 0 2.5%;
text-align: center;
/*border: 1px solid black;*/
}
.ser-1 h3,
.ser-2 h3,
.ser-3 h3 {
border-bottom: 2px solid #FF0080;
padding: 10px;
margin: 5px 5px 30px;
font-size: 1em;
}
.ser-1 p,
.ser-2 p,
.ser-3 p {
color: rgba(0,0,0, .5);
font-size: .9em;
line-height: 2em;
}
//*REVIEWS*//
.wrap-review {
height: 770px;
}
.content-review {
text-align: center;
height: 770px;
background: #FF0080;
color: white;
padding: 1px;
}
.content-review h3 {
margin-top: 80px;
font-size: 1.7em;
}
.review {
background: white;
color: #FF0080;
margin: 20px 2.5%;
border-radius: 2px;
height: 200px;
display: block;
}
.review-content {
text-align: center;
padding: 40px 20px 20px;
}
.review-name {
font-style: italic;
font-weight: bold;
}
.review-name-img {
display: none;
}
//*FORM*//
.wrap-form {
height: 770px;
padding: 1px;
}
.wrap-form-contect {
text-align: center;
height: 770px;
padding: 1px;
margin: 70px 10px 10px;
border: 5px solid black;
}
.wrap-form-contect p {
text-transform: capitalize;
line-height: 1.5em;
font-size: .95em;
}
input,
textarea {
border: none;
background: #eee;
margin: 10px;
padding: 20px;
}
textarea {
padding: 30px;
}
button {
display: block;
margin: 10px auto;
background: #FF0080;
color: white;
border: none;
padding: 20px;
width: 75%;
font: bold 1.4em/1 sans-serif;
}
button:hover {
cursor: pointer;
background: yellow;
color: black;
transition: .5s;
}
//*FOOTER*//
footer {
background: black;
height: 500px;
margin: 500px;
padding: 500px;
width: 90%;
}
<!DOCTYPE html>
<html>
<head>
<title>FSA Doc.</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style/nor.css">
<link rel="stylesheet" type="text/css" href="style/main.css">
</head>
<body>
<header>
<div class="logo">
<img src="img/black.png" alt="FSA Doc.">
</div>
<nav>
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>REVIEWS</li>
<li>CONTACT US</li>
</ul>
</nav>
</header>
<div class="head-content">
<h1>FSA Doc.</h1>
<a class="bth" href="#">CALL (866) 210-1337</a>
<a class="bth" href="#">LEARN MORE</a>
</div>
<div class="headline">
<h2>LEARN MORE</h2>
<h3>about how we help</h3>
</div>
<div class="ser-1">
<h3>SATISFACTION GUARANTEED</h3>
<p>Document Prep Express has a stellar success rate and we strive to provide services will get you the best results possible!</p>
</div>
<div class="ser-2">
<h3>NO UPFRONT FEES</h3>
<p>Period.</p>
</div>
<div class="ser-3">
<h3>WE’RE HERE TO HELP</h3>
<p>Confused? Don’t know where to turn? Our experts will answer all your questions.</p>
</div>
<div class="review">
<h3 class="head-review">what people say</h3>
<div class="review-contienr">
<p class="review">“FSA Doc. saved me from losing my car and apartment! I could not thank Document Prep Express enough.”</p>
<h3 class="reivew-name">Lindsay Anderson</h3>
</div>
<div class="review-contienr">
<p class="review">“Experts in their field! They told me everything to look out for and acted quickly”</p>
<h3 class="reivew-name">Ashley Guthrie</h3>
</div>
</div>
<div class="wrap-form">
<h3>get started</h3>
<p>let us know what can we do for you</p>
<form>
<input value="Your Name" type="text">
<input value="Email" type="text">
<textarea>Your Message</textarea>
<button type="submit">Send</button>
</form>
</div>
<footer>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</footer>
</body>
</html>
Remove the double back slashes from your css comments. Proper css comment syntax looks like this:
/* comment */