As I work on constructing a website, I'm facing an issue with the top two sections. They appear correctly when my screen is full size, but as soon as I adjust the screen size, they jump down and create white space.
It seems like I may have approached this project incorrectly, as some other elements are not functioning as expected.
Below is the CSS code:
/* This Resets All Styles */
* {
hight: 100%;
margin: 0;
padding: 0;
}
/*layout*/
p {
line-height: 20px;
margin-bottom: 10px;
}
body {
font-family: 'Open Sans', sans-serif;
}
h1 {
color: #fff;
font-size: 55px;
font-weight: normal;
margin: 0;
padding: 0;
text-align: center;
}
h2 {
color: #fff;
font-size: 40px;
font-weight: normal;
margin: 0;
padding: 0;
text-align: center;
}
h3 {
font-size: 22px;
font-style: italic;
font-weight: 400;
margin: 5px 0;
padding: 20px;
position: inherit;
text-align: center;
z-index: 1;
}
/*boards*/
#board_1, #board_2, #boar_3, #board_4 {
width: 100%;
}
#board_1 {
background: url(../img/background_5.png);
min-height: 750px;
background-repeat: no-repeat;
background-size: cover;
height: 100%;
margin: 0 auto;
}
.board1_p {
border-bottom: 30px solid;
color: white;
font-size: 2em;
max-width: 600px;
padding-left: 60%;
padding-top: 25%;
text-align: center;
}
#board_2 {
background-color: green;
color: #333333;
height: 100%;
margin: 0 auto;
max-height: 1000px;
min-height: 1000px;
}
And here is the HTML-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>John Doe</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.7.1.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,800' rel='stylesheet' type='text/css'>
</head>
<body>
<section id="board_1" />
<div class="board1_p">
<p>Hello! Welcome to my online home where you can learn all about me.</p>
</div>
<header id="main_header">
<div class="content">
<nav class="nav">
<ul>
<li><a href="#board_1" title="Home">Home</a></li>
<li><a href="#board_2" title="About">About</a></li>
<li><a href="#board_3" title="Work">Work</a></li>
<li><a href="#board_4" title="Contact">Contact</a></li>
</ul>
</nav>
</div>
</header>
<section id="board_2">
<h2> About</h2>
<p>Intrigued to know more about me? Dive in!</p>
</section>
<section id="board_3">
<h2>Work</h2>
<p>Explore my portfolio of work, ranging from client projects to personal endeavors.</p>
</section>
<section id="board_4">
<h2>Reach Out</h2>
</section>
</body>
</html>
New HTML-
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<section id="board_1">
<div class="board1_p">
<p>Hello! Welcome to my online home where you can learn all about me.</p>
</div>
</section>;
<section id="board_2">
<header id="main_header">
<div class="content">
<nav class="nav">
<ul>
<li><a href="#board_1" title="Home">Home</a></li>
<li><a href="#board_2" title="About">About</a></li>
<li><a href="#board_3" title="Work">Work</a></li>
<li><a href="#board_4" title="Contact">Contact</a></li>
</ul>
</nav>
</div>
</header>
<h2> About</h2>
<p>Introduce yourself: who are you, what do you do, and why should we care?</p>
</section>
<section id="board_3">
<h2>Work</h2>
<p>Showcase your professional achievements and highlight your skills</p>
</section>
<section id="board_4">
<h2>Get in Touch</h2>
</section>
</body>
</html>
New CSS-
/* This Resets All Styles */
* {
hight: 100%;
margin: 0;
padding: 0;
}
/*layout*/
p {
line-height: 1.2em;
margin-bottom: 10px;
}
body {
font-family: 'Open Sans', sans-serif;
}
h1 {
color: #fff;
font-size: 55px;
font-weight: normal;
margin: 0;
padding: 0;
text-align: center;
}
h2 {
color: #fff;
font-size: 40px;
font-weight: normal;
margin: 0;
padding: 0;
text-align: center;
}
h3 {
font-size: 22px;
font-style: italic;
font-weight: 400;
margin: 5px 0;
padding: 20px;
position: inherit;
text-align: center;
z-index: 1;
}
/*boards*/
#board_1, #board_2, #boar_3, #board_4 {
width: 100%;
}
#board_1 {
background: url(../img/background_5.png);
min-height: 750px;
background-repeat: no-repeat;
background-size: cover;
height: 1020px;
margin: 0 auto;
}
.board1_p {
border-bottom: 30px solid white;
color: white;
font-size: 2em;
max-width: 600px;
padding-left: 60%;
padding-top: 25%;
text-align: center;
}
#board_2 {
background-color: green;
color: #333333;
height: 100%;
margin: 0 auto;
max-height: 1000px;
min-height: 1000px;
}
nav ul li
{
display: inline-block;
margin: 10px;
}
#board_3 {
background-color: blue;
color: #333333;
height: 100%;
margin: 0 auto;
max-height: 1000px;
min-height: 1000px;
}
#board_4 {
background-color: red;
color: #333333;
height: 100%;
margin: 0 auto;
max-height: 1000px;
min-height: 1000px;
}