I've been following a tutorial on web design from tutsplus. I have completed everything except for one issue with the HTML styling. You can see I have included height:100%, but in the original tutorial, that line was not there. If I remove it, the layout collapses. However, in the original tutorial, it looks perfect. Can anyone explain why?
Currently, with height:100% set, you can scroll to the bottom and notice there is some margin left at the bottom. I want the image to stick right at the bottom of the page.
Please download the images as well so you can try this code. Here are the links:
CodePen = http://codepen.io/joe/full/xruKk
jsFiddle = http://jsfiddle.net/rssatnam/YekQe/embedded/result/
Here is the code :
<html>
<head>
<style type="text/css">
html{
background:#77d5fb url('bottom_bg.jpg') bottom center no-repeat;
height:100%;
}
body{
background:transparent url('top_bg.png') top center no-repeat;
height:100%;
width:100%;
margin:0 0;
}
#container{
width:900px;
margin:0 auto;
}
#navBar{
height:62px;
background-color:#e5592e;
margin:3em 0;
position:relative;
-webkit-box-shadow:0px 0px 4px rgba(0,0,0,0.55);
box-shadow:0px 0px 4px rgba(0,0,0,0.55);
-moz-box-shadow:0px 0px 4px rgba(0,0,0,0.55);
-o-box-shadow:0px 0px 4px rgba(0,0,0,0.55);
border-radius:3px;
z-index:500;
}
#menu li{
list-style-type:none;
display:block;
float:left;
margin:1em 0.8em;
}
#menu li a{
display:block;
text-decoration:none;
color:#F0F0F0;
font-size:1.6em;
margin:0;
line-height:28px;
text-shadow:0 2px 1px rgba(0, 0,0, 0.5);
}
#menu li a:hover{
/*transition:margin-top 0.3s;
-webkit-transition:margin-top 0.3s;*/
margin-top:2px;
}
#lt-corner {
width:0px;
height:0px;
border:50px solid;
border-color:#d9542b transparent transparent;
position:relative;
float:left;
top:1px;
left:-50px;
}
#lb-corner{
border:50px solid;
border-color:transparent transparent #d9542b;
width:0px;
height:0px;
position:relative;
float:left;
top:-40px;
left:-150px;
}
#rt-corner {
width:0px;
height:0px;
border:50px solid;
border-color:#d9542b transparent transparent;
position:relative;
float:right;
top:-107px;
right:-45px;
}
#rb-corner {
border:50px solid;
border-color:transparent transparent #d9542b;
width:0px;
height:0px;
position:relative;
float:right;
top:-149px;
right:-145px;
}
</style>
</head>
<body>
<div id="container">
<div id="lt-corner"></div>
<div id="lb-corner"></div>
<div id="navBar">
<ul id="menu">
<li><a href="#">✭ Home</a></li>
<li><a href="#">✭ About</a></li>
<li><a href="#">✭ Services</a></li>
<li><a href="#">✭ Contact</a></li>
</ul>
</div>
<div id="rt-corner"></div>
<div id="rb-corner"></div>
</div>
</body>
</html>