Related
I have a header that needs to have a greeting div inside of it. And that div has to be styled with :before and :after. I cannot add it via HTML. But when you resize the window, everything gets messed up. And I have no idea how to stop it from happening, without changing the font-size.
Can someone please take a look and tell me if there's something I can do? Thank you!
.header {
background-image: url('http://lorempixel.com/1300/800/');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
min-height: 765px;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translateY(-50%) translateX(-50%);
padding: 0px 20px 7px 20px;
border: 1px solid #fff;
outline: 2px solid #000;
box-shadow: 0 0 15px 0 rgba(0, 0, 0, .375);
font-size: 3em;
font-weight: 700;
color: #fff;
line-height: 1.3;
}
.title:before {
font-family: FontAwesome;
content: "\f051";
font-size: 1.5em;
vertical-align: bottom;
}
.title:after {
content: "Hello hello";
position: absolute;
font-size: 17px;
font-weight: 400;
text-transform: uppercase;
display: block;
top: 15px;
left: 75px;
line-height: 1;
}
<div class="header">
<div class="title">
Hello
</div>
</div>
you may try this code, removed the absolute position :
.header {
background-image: url('http://lorempixel.com/1300/800/');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
min-height: 765px;
text-align:center;
}
.title {
position: relative;
display:inline-block;
margin-top:15%;
padding: 0px 20px 7px 20px;
border: 1px solid #fff;
outline: 2px solid #000;
box-shadow: 0 0 15px 0 rgba(0, 0, 0, .375);
font-size: 3em;
font-weight: 700;
color: #fff;
line-height: 1.3;
}
.title:before {
font-family: FontAwesome;
content: "\f051";
font-size: 1.5em;
vertical-align: bottom;
}
.title:after {
content: "Hello hello";
position: absolute;
font-size: 17px;
font-weight: 400;
text-transform: uppercase;
display: block;
top: 15px;
left: 75px;
line-height: 1;
}
<div class="header">
<div class="title">
Hello
</div>
</div>
please I want to move this elements from the sidebar to this left space area but I can't I think there is a problem with this code
Screenshot
<div class='clear'/>
<span class='widget-item-control'>
<span class='item-control blog-admin'>
<a class='quickedit' href='//www.blogger.com/rearrange?blogID=4692355700320814336&widgetType;=HTML&widgetId;=HTML7&action;=editWidget§ionId;=sidebar-left' onclick='return _WidgetManager._PopupConfig(document.getElementById("HTML7"));' target='configHTML7' title='تحرير'>
<img alt='' height='18' src='https://resources.blogblog.com/img/icon18_wrench_allbkg.png' width='18'/>
</a>
</span>
</span>
<div class='clear'/>
</div><div class='widget HTML' data-version='1' id='HTML4'>
<h2 class='title'>تابعنى على الفيس بوك</h2>
<div class='widget-content'>
<iframe allowtransparency='true' frameborder='0' height='180' scrolling='no' src='https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2F%D8%A5%D9%8A%D9%87%D8%A7%D8%A8-%D8%A8%D9%84%D9%88%D8%AC-%D9%84%D9%84%D8%AA%D9%82%D9%86%D9%8A%D8%A9-%D9%88%D8%A7%D9%84%D8%AA%D8%B7%D9%88%D9%8A%D8%B1-1481672011862823andtabs;.width=280.height=180.small_header=false.adapt_container_width=true.hide_cover=false.show_facepile=true.appId=1426898060671616' style='border:none;overflow:hidden' width='300'/>
</div>
Css Code
#sidebar-wrapper-left {margin:0 auto;}
#sidebar-wrapper-right {margin:0 auto;}
#sidebar-wrapper-center {margin:0 auto;}
.clear {
clear: both;
}
#media (max-width: 767px) {
#footer-container {
text-align: center;
}
#copyright {
display: block !important;
}
.social-menu {
float: none !important;
}
/*- - - - -Sidebar- - - - */
#sidebar-wrapper-left .widget{border-radius: 0;padding-bottom: 5px;background:#fff;box-shadow: 0 1px 3px 0 rgba(0,0,0,.1);
font-family:Lobster,ge_dinar_tworegular;margin-bottom:16px}
#sidebar-wrapper-left .widget:hover{box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);}
#sidebar-wrapper-left .widget-content{padding:5px;width:95%;margin:0px;margin-top:5px}
#sidebar-wrapper-left h2{border-radius: 0;background:#254E71;color:#fff;clear: both;
font-family:Lobster,ge_dinar_tworegular;font-size:18px;font-weight:normal;margin:0px;border: 5px solid;padding: 7px 65px 5px 0px;position:relative;transition:all .5s ease-out}
#sidebar-wrapper-left h2:before{ content: '\f005'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0; right: 0; bottom: 0;position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 34px}
#sidebar-wrapper-left h2:hover{ background-color:#F74047;text-decoration: none; transition: 1.0s; background: #29567D; background-image: linear-gradient(110deg, #254E71 0%, #254E71 50%, transparent 50%, transparent 100%); background-size: 200%; background-position: 150% 0; background-repeat: no-repeat; transition: background-position 1.9s ease, color 1.15s ease;}
#sidebar-wrapper-right .widget{border-radius: 0;padding-bottom: 5px;background:#fff;box-shadow: 0 1px 3px 0 rgba(0,0,0,.1);
font-family:Lobster,ge_dinar_tworegular;margin-bottom:16px}
#sidebar-wrapper-right .widget:hover{box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);}
#sidebar-wrapper-right .widget-content{padding:5px;width:95%;margin:0px;margin-top:5px}
#sidebar-wrapper-right h2{border-radius: 0;background:#254E71;color:#fff;font-family:Lobster,ge_dinar_tworegular;font-size:17px;font-weight:normal;margin:0px;clear: both;padding: 7px 55px 5px 0px;position:relative;transition:all .5s ease-out; border-bottom: 1px solid #eee;border: 5px solid;}
#sidebar-wrapper-right h2:hover{ background-color:#F74047;text-decoration: none; transition: 1.0s; background: #29567D; background-image: linear-gradient(110deg, #254E71 0%, #254E71 50%, transparent 50%, transparent 100%); background-size: 200%; background-position: 150% 0; background-repeat: no-repeat; transition: background-position 1.9s ease, color 1.15s ease;}
#sidebar-wrapper-right h2:before{ content: '\f123'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0; right: 0; bottom: 0;position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 34px}
=
#PopularPosts1 h2:before{ content: '\f016'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0; right: 0; bottom: 0;position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 34px}
#ContactForm1 h2:before{ content: '\f003'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0; right: 0; bottom: 0;position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 34px}
#PageList1 h2:before{ content: '\f097'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0; right: 0; bottom: 0;position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 34px}
#BlogArchive1 h2:before{ content: '\f0c7'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0; right: 0; bottom: 0;position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 34px}
#Image1 h2:before{ content: '\f123'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0; right: 0; bottom: 0;position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 34px}
#HTML3 h2:before { content: '\f059'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0;bottom: 0; right: 0; position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 37px; }
#FollowByEmail1 h2:before {content: '\f003'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0;bottom: 0; right: 0; position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 37px;}
#Followers1 h2:before {content: '\f0c0'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0;bottom: 0; right: 0; position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 37px; }
#HTML2 h2:before {}
.sidebar h2:before { content: '\f005'; font-family: FontAwesome; font-style: normal; font-weight: normal; top: 0;bottom: 0; right: 0; position: absolute; padding: 0.4px 13px; background: #F74047; color: #fff; line-height: 37px; }
#HTML1 h2:before { content: '\f0e6'; font-family: FontAwesome; font-style: normal; font-weight: normal;
top: 0; bottom: 0;right: 0; position: absolute; padding: 0.4px 13px;
background: #F74047; color: #fff; line-height: 37px;}
#Label1 h2:before {content: '\f02c';font-family: FontAwesome;font-style: normal;font-weight: normal;top: 0;bottom: 0;right: 0;position: absolute;padding: 2.4px 13px;background: #F74047; color: #fff;line-height: 30px;}
#BlogArchive h2:before {content: '\f187';font-family: FontAwesome;font-style: normal;font-weight: normal;top: 0;bottom: 0;right: 0;position: absolute;padding: 2.4px 13px;background: #F74047; color: #fff;line-height: 30px;}
#BImage1:before {content: '\f005';font-family: FontAwesome;font-style: normal;font-weight: normal;top: 0;bottom: 0;right: 0;position: absolute;padding: 2.4px 13px;background: #F74047; color: #fff;line-height: 30px;}
.quickedit{display:none;}
html {overflow-x: hidden;}
and there is a problem wih "&"
please tell me what should I do ...
and this is the website if u want to see the source of the page
http://shefoblog.blogspot.com.eg/
The class .post-thumb-oi-web has a width, but does not have a float and that is why your main container and sidebar are not side by side.
I would suggest you give the width and float to the container of your main content, which seems to be .date-posts.
.date-posts {
float: right;
width: 821px;
}
should do the trick and then you can remove the width from .post-thumb-oi-web.
Hello does anyone know why my left green checkbox is not aligned on left of the text ? Here is my code and what I see right now.
I want something like this "V Etendre le linge X" for one row (V is the checkbox and X is the destroy button)
html,
body {
margin: 0;
padding: 0;
}
button {
margin: 0;
padding: 0;
border: 0;
background: none;
font-size: 100%;
vertical-align: baseline;
font-family: inherit;
color: inherit;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
}
body {
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.4em;
background: #eaeaea url('../bower_components/todomvc-common/bg.png');
color: #4d4d4d;
width: 550px;
margin: 0 auto;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
font-smoothing: antialiased;
}
.sapUiTv, .sapUiBtnS {
font: inherit;
font-size: inherit;
}
#todoapp {
background: #fff;
background: rgba(255, 255, 255, 0.9);
margin: 130px 0 40px 0;
border: 1px solid #ccc;
position: relative;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.2),
0 25px 50px 0 rgba(0, 0, 0, 0.15);
}
#todoapp:before {
content: '';
border-left: 1px solid #f5d6d6;
border-right: 1px solid #f5d6d6;
width: 2px;
position: absolute;
top: 0;
left: 40px;
height: 100%;
}
#todoapp input::-webkit-input-placeholder {
font-style: italic;
}
#todoapp input:-moz-placeholder {
font-style: italic;
color: #a9a9a9;
}
#todoapp h1 {
position: absolute;
top: -120px;
width: 100%;
font-size: 70px;
font-weight: bold;
text-align: center;
color: #b3b3b3;
color: rgba(255, 255, 255, 0.3);
text-shadow: -1px -1px rgba(0, 0, 0, 0.2);
-webkit-text-rendering: optimizeLegibility;
-moz-text-rendering: optimizeLegibility;
-ms-text-rendering: optimizeLegibility;
-o-text-rendering: optimizeLegibility;
text-rendering: optimizeLegibility;
}
#header {
padding-top: 15px;
border-radius: inherit;
}
#main {
position: relative;
z-index: 2;
border-top: 1px dotted #adadad;
}
#new-todo,
.sapUiTfBrd.sapUiTfRo.todo,
.sapUiTfBrd.sapUiTfStd.todo {
position: relative;
margin: 0;
margin-right: 153px;
width: 100%;
font-size: 24px;
font-family: inherit;
line-height: 1.4em;
background-color: transparent;
border: 0;
outline: none;
color: #4D4D4D;
padding: 6px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
font-smoothing: antialiased;
}
#new-todo {
padding: 15px 15px 16px 60px;
border: none;
background: rgba(0, 0, 0, 0.02);
z-index: 2;
box-shadow: none;
}
#todo-list {
margin: 0;
padding: 0;
list-style: none;
}
#todo-list li {
position: relative;
font-size: 24px;
border-top: 1px dotted #ccc;
}
#todo-list input[type='checkbox'] {
text-align: center;
width: 40px;
/* auto, since non-WebKit browsers doesn't support input styling */
height: auto;
position: absolute;
top: 0;
bottom: 0;
margin: auto 0;
-webkit-appearance: none;
/*-moz-appearance: none;*/
-ms-appearance: none;
-o-appearance: none;
appearance: none;
}
#todo-list input[type='checkbox']:after {
content: '✔';
line-height: 62px;
font-size: 20px;
color: #d9d9d9;
text-shadow: 0 -1px 0 #bfbfbf;
}
#todo-list input[type='checkbox']:checked:after {
color: #85ada7;
text-shadow: 0 1px 0 #669991;
bottom: 1px;
position: relative;
}
#todo-list input:not([type='checkbox']) {
word-break: break-word;
padding: 15px;
margin-left: 45px;
display: block;
line-height: 1.2em;
-webkit-transition: color 0.4s;
-moz-transition: color 0.4s;
-ms-transition: color 0.4s;
-o-transition: color 0.4s;
transition: color 0.4s;
}
#todo-list li .destroy {
outline: none;
background-color: transparent;
display: none;
position: absolute;
top: 0;
right: 10px;
bottom: 0;
width: 40px;
height: 40px;
margin: auto 0;
font-size: 22px;
color: #a88a8a;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
#todo-list li .destroy:hover {
text-shadow: 0 0 1px #000,
0 0 10px rgba(199, 107, 107, 0.8);
-webkit-transform: scale(1.3);
-moz-transform: scale(1.3);
-ms-transform: scale(1.3);
-o-transform: scale(1.3);
transform: scale(1.3);
}
#todo-list li .destroy:after {
content: '✖';
}
#todo-list li:hover .destroy {
display: block;
}
#todo-list .sapUiRrNoData,
#todo-list .sapUiRrPtb,
#todo-list .sapUiRrFtr {
display: none;
}
<html>
<head>
<meta charset="UTF-8"/>
<title>MyTodoList</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section id = "todoapp">
<header id="header">
<h1>MyTodoList</h1>
<form action="#" id="todo-form">
<input type="text" id="new-todo" placeholder="New task" autofocus autocomplete="off">
</form>
</header>
<section id = "main">
<u1 id = "todo-list">
<li>
<div class="view">
<input type="checkbox" class="toggle">
<label>Etendre le linge</label>
<button class="destroy"></button>
</div>
</li>
</u1>
</section>
</section>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/angularjs/1.0.3/angular.min.js"></script>
</body>
</html>
You have position:absolute on your checkbox. Removing it fixes the issue.
#todo-list input[type='checkbox'] {
text-align: center;
width: 40px;
height: auto;
/* position: absolute; */
/* top: 0; */
/* bottom: 0; */
margin: auto 0;
-webkit-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
}
https://jsfiddle.net/qd2o38fp/1/
I want the user to be able to hover over the circle, and then click the circle itself to be directed to another link. (not the text when hovered)
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: default;
box-shadow:
inset 0 0 0 16px rgba(255,255,255,0.6),
0 1px 2px rgba(0,0,0,0.1);
transition: all 0.4s ease-in-out;
content: url(www.yahoo.com);
}
I tried to put
content: url(www.yahoo.com);
but this makes the text disappear for some reason.
If you want to be able to click it, it must be a link:
<a href="//www.yahoo.com" class="ch-info">
<h3>See Portfolio</h3>
</a>
Just display it as a block, and your current code will work:
.ch-info {
display: block;
}
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid::after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
transition: all 0.4s ease-in-out;
}
.ch-img-1 {
background-image: url(http://www.pulsarwallpapers.com/data/media/3/Alien%20Ink%202560X1600%20Abstract%20Background.jpg);
}
.ch-img-2 {
background-image: url(../images/2.jpg);
}
.ch-img-3 {
background-image: url(../images/3.jpg);
}
.ch-info {
position: absolute;
background: rgba(63, 147, 147, 0.8);
width: inherit;
height: inherit;
border-radius: 50%;
overflow: hidden;
opacity: 0;
transition: all 0.4s ease-in-out;
transform: scale(0);
display: block;
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 22px;
margin: 0 30px;
padding: 45px 0 0 0;
height: 140px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
opacity: 0;
transition: all 1s ease-in-out 0.4s;
}
.ch-info p a {
display: block;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
}
.ch-info p a:hover {
color: rgba(255, 242, 34, 0.8);
}
.ch-item:hover {
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
transform: scale(1);
opacity: 1;
}
.ch-item:hover .ch-info p {
opacity: 1;
}
.ch-item::before {
content: "P";
position: absolute;
font-size: 180px;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
<ul class="ch-grid">
<li>
<div class="ch-item ch-img-1">
<a href="//www.yahoo.com" class="ch-info">
<h3>See Portfolio</h3>
</a>
</div>
</li>
</ul>
extending Oriol's you could also use clip-path: circle(110px at center);
to limit :hover selection
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid::after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
transition: all 0.4s ease-in-out;
}
.ch-img-1 {
background-image: url(http://www.pulsarwallpapers.com/data/media/3/Alien%20Ink%202560X1600%20Abstract%20Background.jpg);
}
.ch-img-2 {
background-image: url(../images/2.jpg);
}
.ch-img-3 {
background-image: url(../images/3.jpg);
}
.ch-info {
position: absolute;
background: rgba(63, 147, 147, 0.8);
width: inherit;
height: inherit;
border-radius: 50%;
overflow: hidden;
opacity: 0;
transition: all 0.4s ease-in-out;
transform: scale(0);
display: block;
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 22px;
margin: 0 30px;
padding: 45px 0 0 0;
height: 140px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
opacity: 0;
transition: all 1s ease-in-out 0.4s;
}
.ch-info p a {
display: block;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
clip-path: circle(110px at center);
}
.ch-info p a:hover {
color: rgba(255, 242, 34, 0.8);
clip-path: circle(110px at center);
}
.ch-item:hover {
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
clip-path: circle(110px at center);
}
.ch-item:hover .ch-info {
transform: scale(1);
opacity: 1;
}
.ch-item:hover .ch-info p {
opacity: 1;
}
.ch-item::before {
content: "P";
position: absolute;
font-size: 180px;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
<ul class="ch-grid">
<li>
<div class="ch-item ch-img-1">
<a href="//www.yahoo.com" class="ch-info">
<h3>See Portfolio</h3>
</a>
</div>
</li>
</ul>
I set up a sticky footer at my site using this method, and for some reason there's a large amount of extra space between the bottom of the content and the top of the footer. I can't figure out why. Since there's not much content on the first page, the page shouldn't even extend beyond the viewport and there shouldn't be scrollbars. What's going on?
Here's the code for the page:
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/pygment_trac.css" media="screen" />
<link href="/menu_assets/styles.css" rel="stylesheet" type="text/css">
<title>gulshansingh.com</title>
</head>
<body>
<header>
<img src="/images/banner.jpg">
</header>
<div id='cssmenu'>
<ul>
<li><a href='/'><span>Home</span></a></li>
<li><a href='/about/'><span>About</span></a></li>
<li><a href='/projects/'><span>Projects</span></a></li>
<li><a href='/articles/'><span>Articles</span></a></li>
</ul>
</div>
<div class="container">
<section id="main_content">
<h3>Welcome to GitHub Pages.</h3>
<p>This is a test home page for my site</p>
<pre><code>$ cd your_repo_root/repo_name
$ git fetch origin
$ git checkout gh-pages
</code></pre>
<h3>Section 2</h3>
<p>Lorem ipsum</p>
</section>
<div class="push">
</div>
</div>
<div id="footer">
Footer content goes here
</div>
</body>
</html>
Here is the CSS (Although looking at Firebug/CDT might be more helpful):
* {
margin: 0;
}
html, body {
height: 100%;
min-height: 100%;
}
.container {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -80px; /* the bottom margin is the negative value of the footer's height */
}
#footer, .push {
height: 80px; /* .push must be the same height as .footer */
}
body {
margin: 0;
padding: 0;
background: #161616;
color: #eaeaea;
font: 16px;
line-height: 1.5;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
}
/* General & 'Reset' Stuff */
.container {
width: 100%;
}
section {
display: block;
margin: 0 0 20px 0;
}
h1, h2, h3, h4, h5, h6 {
margin: 15px 0 5px;
}
p {
margin: 0 0 5px;
}
li {
line-height: 1.4 ;
}
header, header img {
position: relative;
z-index: 10;
width: 100%;
height: 150px;
box-shadow: 0 0 5px #469B46;
-webkit-box-shadow: 0 0 5px #469B46;
-moz-box-shadow: 0 0 5px #469B46;
-o-box-shadow: 0 0 5px #469B46;
-ms-box-shadow: 0 0 5px #469B46;
}
#downloads .btn {
display: inline-block;
text-align: center;
margin: 0;
}
/* Main Content
*/
#main_content {
padding: 20px;
background: #474747;
width: 80%;
margin: 50px auto;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-webkit-font-smoothing: antialiased;
}
section img {
max-width: 100%
}
h1, h1 a, h2, h2 a, h3, h3 a, h4, h4 a, h5, h5 a, h6, h6 a {
font-weight: normal;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
color: #b5e853;
letter-spacing: -0.03em;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1),
0 0 5px rgba(181, 232, 83, 0.1),
0 0 10px rgba(181, 232, 83, 0.1);
-moz-transition: all 0.3s ease-out; /* FF3.7+ */
-o-transition: all 0.3s ease-out; /* Opera 10.5 */
-webkit-transition: all 0.3s ease-out; /* Saf3.2+, Chrome */
transition: all 0.3s ease-out;
}
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
color: #ccc;
}
#main_content h1 {
font-size: 30px;
}
#main_content h2 {
font-size: 24px;
}
#main_content h3 {
font-size: 18px;
}
#main_content h4 {
font-size: 14px;
}
#main_content h5 {
font-size: 12px;
text-transform: uppercase;
margin: 0 0 5px 0;
}
#main_content h6 {
font-size: 12px;
text-transform: uppercase;
color: #999;
margin: 0 0 5px 0;
}
dt {
font-style: italic;
font-weight: bold;
}
/*
ul li {
list-style: none;
}
ul li:before {
content: ">>";
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
font-size: 13px;
color: #b5e853;
margin-left: -37px;
margin-right: 21px;
line-height: 16px;
}*/
blockquote {
color: #aaa;
padding-left: 10px;
border-left: 1px dotted #666;
}
pre {
background: rgba(0, 0, 0, 0.9);
border: 1px solid rgba(255, 255, 255, 0.15);
padding: 10px;
font-size: 14px;
color: #b5e853;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
text-wrap: normal;
overflow: auto;
overflow-y: hidden;
}
table {
width: 100%;
margin: 0 0 20px 0;
}
th {
text-align: left;
border-bottom: 1px dashed #b5e853;
padding: 5px 10px;
}
td {
padding: 5px 10px;
}
hr {
height: 0;
border: 0;
border-bottom: 1px dashed #b5e853;
color: #b5e853;
}
/* Buttons
*/
.btn {
display: inline-block;
background: -webkit-linear-gradient(top, rgba(40, 40, 40, 0.3), rgba(35, 35, 35, 0.3) 50%, rgba(10, 10, 10, 0.3) 50%, rgba(0, 0, 0, 0.3));
padding: 8px 18px;
border-radius: 50px;
border: 2px solid rgba(0, 0, 0, 0.7);
border-bottom: 2px solid rgba(0, 0, 0, 0.7);
border-top: 2px solid rgba(0, 0, 0, 1);
color: rgba(255, 255, 255, 0.8);
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 13px;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.75);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn:hover {
background: -webkit-linear-gradient(top, rgba(40, 40, 40, 0.6), rgba(35, 35, 35, 0.6) 50%, rgba(10, 10, 10, 0.8) 50%, rgba(0, 0, 0, 0.8));
}
.btn .icon {
display: inline-block;
width: 16px;
height: 16px;
margin: 1px 8px 0 0;
float: left;
}
.btn-github .icon {
opacity: 0.6;
background: url("../images/blacktocat.png") 0 0 no-repeat;
}
/* Links
a, a:hover, a:visited
*/
a {
color: #63c0f5;
text-shadow: 0 0 5px rgba(104, 182, 255, 0.5);
}
/* Clearfix */
.cf:before, .cf:after {
content:"";
display:table;
}
.cf:after {
clear:both;
}
.cf {
zoom:1;
}
#footer {
border-top: 2px solid #15893d;
text-align: center;
width: 100%;
height: 80px;
background: #0c0c0c;
line-height: 80px;
}
#footer_inner {
display: table-cell;
}
#footer a {
text-decoration: none;
color: #eaeaea;
}
#footer a:hover {
text-decoration: underline;
color: #eaeaea;
}
The .container element should wrap around all the other elements in the body except for the footer. This means you have to place the header in the .container element as well, because it's height of 100% means it will take up the height of the viewport. Since your header/navigation has been excluded from the .container element, the viewport height will be extended down further by the height of the header.
And please consider posting your example in a fiddle instead of your site, or any other external site that makes it too localized and less relevant to the rest of the SO community.