StanleyDev
Member
- Nov 13, 2011
- 35
- 0
I'm trying to create a template for my assignment before I start making the webpages, and Im currently stuck, When I insert multiple content box's my sidebar moves down, I'm not sure how to fix this, with just one content box it's fine, but when I insert more the sidebar shifts down.
The HTML:
The CSS:
The HTML:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/sitecss.css">
</head>
<body>
<!-- nav bar code -->
<nav class="nav">
<a class="zenitLink" href="#">My Zenit Account</a>|
<a class="home" href="#">Home</a> |
<a class="imgGal" href="#">Photo Gallery</a> |
<a class="video" href="#"> Video</a> |
<a class="audio" href="#">Audio</a> |
<a class="html5" href="#">HTML5</a> |
<a class="tblCSS" href="#">Tables with CSS</a> |
<a class="forms" href="#">Forms</a> |
<a class="cssUsed" href="#">CSS Used</a> |
<a class="extra" href="#">Extra</a>
</nav>
<!-- end of nav bar code -->
<!-- content -->
<div id="mainContent">
<h3>HTML5 & CSS Normalize</h3>
<p>testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test test</p>
</div>
<div id="secondaryContent">
<h3>HTML5 & CSS Normalize</h3>
<p>testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test testtest test test test</p>
</div>
<!-- end of content -->
<!-- side Bar code code -->
<aside id="sideBar">
<p>testtest testttest test test testtest test test testtest test test testttest test test testtest test test testtest test test testttest test test testtest test test testtest test test testttest test test testtest test test testtest test test testttest test test testtest test test testtest test test test</p>
</aside>
<!-- end of side bar code -->
<!-- social media bar -->
<aside id="socialMedia">
<center><img src="images/social-media.png"></center>
</aside>
<!-- end of social media bar -->
</body>
</html>
The CSS:
Code:
body{
background-color: #A0D8F1;
padding: 0px;
width: 1280px;
}
.nav{
/*background-image: url(../images/navBG.png);*/
background-color: #0A224E;
color: white;
font-family: Tahoma, Geneva, sans-serif;
margin: 0px;
padding-top: 20px;
width: 1280px;
height: 40px;
}
.zenitLink{
color: white;
padding: 20px;
}
.home{
color: white;
padding: 20px;
}
.imgGal{
color: white;
padding: 20px;
}
.video{
color: white;
padding: 20px;
}
.audio{
color: white;
padding: 20px;
}
.html5{
color: white;
padding: 20px;
}
.tblCSS{
color: white;
padding: 20px;
}
.forms{
color: white;
padding: 20px;
}
.cssUsed{
color: white;
padding: 20px;
}
.extra{
color: white;
padding: 20px;
}
#sideBar {
width: 280px;
height: auto ;
float: right;
padding-bottom: 15px;
padding-top: 15px;
background-color: #BF381A;
}
#sideBar p{
margin-top: 16px;
height: auto;
margin-bottom: 16px;
text-align: center;
padding-left: 10px;
padding-right: 10px;
}
#socialMedia{
width: 280px;
height: auto;
float: right;
clear: both;
background-color: #E07628;
}
#socialMedia img{
margin-top: 30px;
margin-bottom: 30px;
margin-left: 15px;
margin-right: 15px;
}
#mainContent{
width: 980px;
float: left;
clear: both;
background-color: #E9AF32;
margin-left: 10px;
margin-top: 30px;
clear: both;
}
#mainContent h3, p{
padding-left: 10px;
padding-right: 10px;
}
#secondaryContent{
width: 980px;
float: left;
clear: both;
background-color: #E9AF32;
margin-left: 10px;
}
#secondaryContent h3, p{
padding-left: 10px;
}