I am wrapping my page inside a main wrapper div but outer div doesn't expand with inner div.
I want height of main outer div main-wrapper to grow with page contents which is not happening for some reason
I am trying to figure out this problem for sometime but so far no success.
I have set up jsFiddle Example
I would help in this regard.
HTML Structure sample
<!-- main Container -->
<div class="main-wrapper">
<!-- Header -->
<div class="header-wrapper"></div>
<!-- Header -->
<div class="content-wrapper">
<!-- Content Page-->
<!-- banner image wrapper -->
<div class="top-image-wrapper"></div>
<!-- banner image wrapper -->
<!-- page content wrapper -->
<div id="page-content-area" class="page-content-area">
<div id="pg-intro-area" class="pg-intro-area">
<div class="page-title">
<h5>Page Title </h5>
</div>
<div class="page-text"></div>
</div>
<div class="pg-right-bar-wrapper"></div>
</div>
<!-- page content wrapper -->
<!-- Content Page-->
</div>
<div class="footer-wrapper"></div>
</div>
<!-- main Container -->
CSS Related
html, body,form { height:100%; background-color:gray; }
body {
font-family: Verdana,"Trebuchet MS",Arial,sans-serif;
-webkit-font-smoothing: antialiased;
font-size: 11px;
line-height: 16px;
height:100%; margin:0;padding:0; border:0;
color:#656565;
}
p
{
text-align:justify;
color:#687074;
}
hr
{
background-color: #ccc;
border: medium none;
height: 1px;
margin-bottom: 12px;
margin-top: 12px;
}
h5 /* for page title*/
{
font-size:15px;
color:#028F41;
margin:5px 0;
}
.page-title-lbl
{
font-size:15px;
color:#028F41;
padding-left:105px;
background-image:url("../images/title-bar.png");
background-repeat:no-repeat;
text-shadow:0 0 0px #F6F6F6;
}
img
{
border:0px
}
a {
color: #028F41;
text-decoration: none;
}
a:hover,
a:focus {
text-decoration: underline;
}
input {
border: 1px solid #ccc;
font-size: 12px;
height: 20px;
line-height:20px;
vertical-align:middle;
padding-left: 5px;
color:#656565;
}
.btn
{
background-color: #0A8F36;
border: 0 none;
color: #FFFFFF;
font-size: 12px;
font-weight:bold;
height: 24px;
line-height:24px;
}
.margin5-0
{
margin:5px 0;
}
.margin10-0
{
margin:10px 0;
}
.margin20-0
{
margin:20px 0;
}
.padding5-0
{
padding:10px 0;
}
.padding10-0
{
padding:10px 0;
}
.padding20-0
{
padding:20px 0;
}
.margin10-000
{
margin:10px 0 0 0;
}
.margin00-5-0
{
margin:0 0 5px 0;
}
.margin00-10-0
{
margin:0 0 10px 0;
}
.margin20-000
{
margin:20px 0 0 0;
}
.margin00-20-0
{
margin:0 0 20px 0;
}
.main-wrapper
{
width:1000px;
min-height: 100%;
height: auto !important;
height: 100%;
margin:0px auto 0px auto;
background-color:#fff;
padding-left:10px;
padding-right:10px;
}
.header-wrapper
{
height:130px;
background-color:red;
}
.search-sm-wrapper
{
float:right;
width:250px;
height:100px;
}
.search-wrapper
{
text-align:right;
width:250px;
height:25px;
}
.txtSearch
{
float: right;
height: 20px;
width: 150px;
border-right:0px;
}
.btn-search
{
float:right;
}
.language-wrapper
{
float:right;
text-align:right;
width:250px;
height:20px;
}
.language-link
{
color:#656565;
}
.sm-wrapper
{
float:right;
width:250px;
height:25px;
}
.menu-wrapper
{
height:30px;
width:1000px;
background-color:yellow;
}
.content-wrapper
{
float:left;
height:auto;
}
.footer-wrapper
{
float:left;
width:1000px;
}
.brand-logos
{
height:39px;
}
.marquee
{
float:left;
overflow:hidden;
height:39px;
width:1000px;
border:0px solid #f9f9f9;
}
.footer-banner
{
float:left;
height:96px;
width:1000px;
}
.footer-menu
{
display:none;
}
.footer-copyright
{
float:left;
height:20px;
width:1000px;
}
.top-image-wrapper
{
height:240px;
margin-top:6px;
background-color:#f5f5f5;
}
/* home page*/
.hp-intro-area
{
float:left;
width:570px;
margin-right:30px;
}
.hp-right-bar-wrapper
{
float:left;
width:400px;
}
.tabs-wrapper
{
margin:10px 0;
background-color:#E5E5E5;
height:210px;
overflow:hidden;
}
.tab-name-wrapper
{
width:400px;
height:30px;
line-height:30px;
background-color:#fff;
margin-bottom:10px;
overflow:hidden;
}
.tab-content-wrapper
{
margin:0px 10px;
}
.hp-tab-image
{
float:left;
width:100px;
padding-right:10px;
}
/* Page */
.page-content-area
{
width:100%;
height:100%;
}
.page-sub-menu
{
width:100%;
height:23px;
padding:0px 0px;
background-color:blue;
}
.pg-intro-area
{
float:left;
width:570px;
margin-right:30px;
}
.pg-right-bar-wrapper
{
float:left;
width:400px;
}
.main-wrapper{
overflow:auto;
/* other styles here */
}
Or sometimes it just helps to clear your floats properly:
.main-wrapper:before,
.main-wrapper:after {
content : "";
display : table;
}
.main-wrapper:after {
clear : both;
}
Just add:
display: block;
and
float: left;
to your .main-wrapper class, so it will look like this:
.main-wrapper
{
width:1000px;
min-height: 100%;
height: auto !important;
height: 100%;
margin:0px auto 0px auto;
background-color:#fff;
padding-left:10px;
padding-right:10px;
display: block;
float: left;
}
Related
I'm editing custom css in my Cafepress store. I'm trying to get the store to display differently on mobile and desktop. Cafepress allows me to add to the head tag contents. The media queries at the bottom are what I've added:
<style>
body
{
background-color:#ffffff;
}
#cpWrapper{
padding:0;
background-image:url('http://i3.cpcache.com/image/110358274_400x400.png');
border-bottom: 1px solid #e14c3b;
width:100%;
max-width:1000px;
margin:auto;
}
#shopContainer{
width:96%;
max-width:960;
background-color:#ffffff;
margin:0px auto;
}
#shopBorder{
border:0;
background-color:#e14c3b;
border-top:0;
}
#shopWrapper{
width:94%;
max-width:940;
background-color:#ffffff;
border:0;
padding:20px;
}
#shopHeader{
background-color:#ffffff;
}
.bodyText a{
text-decoration:none;
}
.center
{
margin:auto;
width:50%;
}
.smallsidebartext a{
font-size: 12px;
text-decoration:none;
}
#sidebarContent {
padding: 85px 5px 5px;
position: relative;
}
#sidebarContent table {
width:auto;
}
#sidebarContentTD {
min-width:200px;
}
#shopCollection{
font-family:Georgia,"Times New Roman",Times,serif;
font-size:15px;
font-weight:bold;
font-color:#e14c3b;
left: 7px;
position: absolute;
top: 40px;
}
.promoBox{
margin-top:40px;
}
.sidebarbg {
background-color:#ffffff;
border-right: 1px dashed #e14c3b;
}
#shopName{
font-family:Georgia,Times,serif;
font-size:48px;
color:#e14c3b;
padding:10px 10px;
}
#colorBar{
height:16px;
}
#topNav{
background-color:#ffffff;
font-family:"times New Roman",Times,serif;
font-size:16px;
font-weight:bold;
color:#e14c3b;
text-align:center;
width:96%;
max-width:960px;
margin:auto auto 25px;
border-top: 1px solid #e14c3b;
border-bottom: 1px solid #e14c3b;
padding:0;
}
#topNav ul, #topNav ul li{
margin:0;
padding:0;
list-style:none;
float:left;
}
#topNav ul{
width:96%;
max-width:960px;
}
#topNav ul li a{
display:block;
padding:15px 10px;
line-height:100%;
color:#e14c3b;
text-decoration:none;
}
#searchFormContainer{
width:206px;
float:right;
left: -16px;
position: absolute;
top: 0;
}
#submitSearch{
float:right;
}
#searchTerm{
float:left;
width:125px;
height:16px;
padding:3px;
}
#media (max-width: 849px) {
.showOnDesktop {
display: none;
}}
#media (min-width: 849px) {
.showOnMobile {
display: none;
}}
</style>
Next it allows me to enter code for the header, which I've done as so:
<div class="showOnDesktop">
<div id="shopContainer">
<div id="shopHeader">
<div id="shopName"><a href="https://spaymart.org" rel="nofollow">
<img src="https://spaymart.org/wp-content/uploads/2017/10/Shop-Banner.png">
</a>
</div>
</div>
<div id="topNav">
<ul>
<li>Home</li>
<li><a href="http://www.cafepress.com/<cpstore:id>/s__t-
shirts-clothing">Shirts & Clothing</a></li>
<li>Everything Else
</li>
</ul>
</div>
<div id="shopWrapper">
<div class="showOnMobile">
<div id="shopContainer">
<div id="shopHeader">
<div id="shopName"><a href="https://spaymart.org" rel="nofollow">
<img src="https://spaymart.org/wp-content/uploads/2017/10/Shop-Banner-
MOBILE.png"></a>
</div>
</div>
<div id="topNav">
<ul>
<li>Home</li>
<li><a href="http://www.cafepress.com/<cpstore:id>/s__t-
shirts-clothing">Shirts & Clothing</a></li>
<li>Everything Else
</li>
</ul>
</div>
<div id="shopWrapper">
Finally, it allows me to add the footer code, which I've done like so:
</div><!-- closing shop wrapper -->
</div><!-- closing shop container -->
</div><!-- closing shop class --!>
<div class="clear"> </div>
The current output can be viewed here: http://www.cafepress.com/spaymart
The shop container, along with header and navigation, are displaying. Content/items contained within the shop wrapper are not.
Thank you in advance for any help you might be able to provide.
There are many problems in code, but the main reason is your mobile banner is nested inside of your desktop banner. When screen size is less than 849px, whole desktop container (with all nested elements) disappears.
Here you can grab a clean and workind code: CodePen for cafepress.com
<div class="showOnDesktop">
<div id="shopContainer">
<div id="shopHeader">
<div id="shopName">
<img src="https://spaymart.org/wp-content/uploads/2017/10/Shop-Banner.png">
</div>
</div>
<div id="topNav">
<ul>
<li>Home</li>
<li>Shirts & Clothing</li>
<li>Everything Else</li>
</ul>
</div>
<div id="shopWrapper"></div>
</div>
</div>
<div class="showOnMobile">
<div id="shopContainer">
<div id="shopHeader">
<div id="shopName">
<img src="https://spaymart.org/wp-content/uploads/2017/10/Shop-Banner-MOBILE.png">
</div>
</div>
<div id="topNav">
<ul>
<li>Home</li>
<li>Shirts & Clothing</li>
<li>Everything Else</li>
</ul>
</div>
</div>
</div>
<div id="shopWrapper"></div>
And CSS:
body {
background-color:#ffffff;
}
#cpWrapper {
padding:0;
background-image:url('http://i3.cpcache.com/image/110358274_400x400.png');
border-bottom: 1px solid #e14c3b;
width:100%;
max-width:1000px;
margin:auto;
}
#shopContainer {
width:96%;
max-width:960;
background-color:#ffffff;
margin:0px auto;
}
#shopBorder {
border:0;
background-color:#e14c3b;
border-top:0;
}
#shopWrapper {
width:94%;
max-width:940;
background-color:#ffffff;
border:0;
padding:20px;
}
#shopHeader {
background-color:#ffffff;
}
.bodyText a {
text-decoration:none;
}
.center {
margin:auto;
width:50%;
}
.smallsidebartext a {
font-size: 12px;
text-decoration:none;
}
#sidebarContent {
padding: 85px 5px 5px 5px; // add last padding 5px
position: relative;
}
#sidebarContent table {
width: auto;
}
#sidebarContentTD {
min-width:200px;
}
#shopCollection {
font-family:Georgia,"Times New Roman",Times,serif;
font-size:15px;
font-weight:bold;
font-color:#e14c3b;
left: 7px;
position: absolute;
top: 40px;
}
.promoBox {
margin-top:40px;
}
.sidebarbg {
background-color:#ffffff;
border-right: 1px dashed #e14c3b;
}
#shopName {
font-family:Georgia,Times,serif;
font-size:48px;
color:#e14c3b;
padding:10px 10px;
}
#colorBar {
height:16px;
}
#topNav {
background-color:#ffffff;
font-family:"times New Roman",Times,serif;
font-size:16px;
font-weight:bold;
color:#e14c3b;
text-align:center;
width:96%;
max-width:960px;
margin:auto auto 25px;
border-top: 1px solid #e14c3b;
border-bottom: 1px solid #e14c3b;
padding:0;
}
#topNav ul, #topNav ul li {
margin:0;
padding:0;
list-style:none;
float:left;
}
#topNav ul {
width:96%;
max-width:960px;
}
#topNav ul li a {
display:block;
padding:15px 10px;
line-height:100%;
color:#e14c3b;
text-decoration:none;
}
#searchFormContainer {
width:206px;
float:right;
left: -16px;
position: absolute;
top: 0;
}
#submitSearch {
float:right;
}
#searchTerm {
float:left;
width:125px;
height:16px;
padding:3px;
}
#media screen and (max-width: 849px) {
.showOnDesktop {
display: none;
}
}
#media screen and (min-width: 850px) {
.showOnMobile {
display: none;
}
}
I am not sure how to have the nav bar inside the header its gone outside of the box and now has no background color. I had it position absolute before and it worked but I am trying to find another alternative.I want the logo to also overlap the nav and the nav stretch out to the full width of the header
It is turning up in my browser like this
it looks different in the JS fiddle
here is my code:
http://jsfiddle.net/9nspQ/
HTML
<header>
<img src="../assets/images/logo.png" alt="">
<nav>
<ul>
<li>Tours & Prices</li>
<li>Standard Flights</li>
<li>Meet the Staff</li>
<li>Charters</li>
</ul>
</nav>
</header>
CSS
header {
height: 100px;
background-color: #001D5D;
}
nav {
right:0;
bottom:0;
padding:10px;
background-color:#1CCEAE;
}
nav ul {
margin-left: 500px;
}
nav li {
display: inline-block;
margin-right: 20px;
}
nav li a {
text-decoration: none;
font-size: 1em;
color:white;
}
Just FYI: right:0;bottom:0; have no effect if there is no position assigned
You have many elements that I am not too sure what they are for. I assume you have more code that you're dealing with on your application.
Try this:
.container {
width: 960px;
margin:0 auto;
background-color: blue;
}
#logo{
height:100px;
width:100px;
z-index:10;
top:10px;
position:absolute;
}
header {
padding-top:50px;
height: 70px;
background-color: #001D5D;
}
nav {
width:960px;
padding:10px 0 10px;
text-align:right;
background-color:#1CCEAE;
}
nav li {
display: inline-block;
}
nav li a {
text-decoration: none;
font-size: 1em;
color:white;
}
DEMO
HERE IS THE WAY I WOULD DO IT:
#logo{
height:100px;
width:100px;
z-index:10;
top:15px;
left:30px;
position:absolute;
}
header {
width:100%;
height: 80px;
background-color: #001D5D;
}
ul {
width: 100%;
height:50px;
line-height:50px;
padding:0;
margin:0;
text-align:right;
background-color:#1CCEAE;
}
ul li {
display: inline-block;
padding-right:10px;
}
ul li a {
text-decoration: none;
font-size: 1em;
color:white;
}
DEMO
I'm having trouble putting a sticky footer onto a site I'm working on.
I've tried everything and can't think of what the problem could be.If someone could take a look at the coding id appreciate it.
As some content on the site is only going to be small paragraphs i need a sticky footer to stick to the bottom to stop it floating in the middle of the site.
I have the content in a div that over laps a image and id like the footer to float on the bottom. however when i close the divs i can't get the footer to stay at the bottom, it starts floating under the image banner. Ive tried position:fixed; but i don't want that as it overlaps the content. Thanks
HTML
<!doctype html>
<html><head>
<meta charset="UTF-8">
<title>Linear Partners</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<meta name="viewport" content="initial-scale=1, maximum-scale=2" />
<link href="style1.css" rel="stylesheet" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/modernizr.js"></script>
<script src="js/respond.min.js"></script>
<script src="js/prefixfree.min.js"></script>
<script type='text/javascript' src='js/main.js'></script>
<script>
$(document).ready(function() {
$('#menu-toggle').click(function () {
$('#menu').toggleClass('open');
e.preventDefault();
});
});
</script>
</head>
<body>
<div id="wrap">
<div id="mainpage">
<div id="header">
<img src="images/Linear.Partners.Logo.png" width ="173" height="65" alt="logo">
<nav class="nav clearfix">
<a id="menu-toggle" class="anchor-link" href="#"><img src="images/3lines.png" width ="31" height="25"></a>
<ul class="simple-toggle" id="menu">
<li>Home</li>
<li>About
<ul>
<li>Team</li>
</ul>
</li>
<li>Expertise</li>
<li>Research</li>
<li>Best Practice</li>
<li>Join Our Team</li>
<li>Contact</li>
</ul>
</nav>
</div>
<div id="bg-image"style="background-image:url(images/slide1.jpg); background-position:50% 50%;">
<div id="main" class="wrapper clearfix">
<left>
<h1>Privacy Policy</h1>
<p>Linear Partners are required by law to comply with the UK and European Data Protection legislation. We are committed to ensuring that all employees comply with the Acts in order to maintain the confidentiality of personal data.</p>
</left>
<right>
<h1>Privacy Policy</h1>
Linear Partners are required by law to comply with the UK and European Data Protection legislation. We are committed to ensuring that all employees comply with the Acts in order to maintain the confidentiality of personal data.</right>
</div>
</div>
<div class="clear"></div>
<footer>
<div id="footer-wrapper">
<div id="footer-content">
<div class="Copyright">
Copyright © 2014 Linear Partners. All rights reserved.
</div>
<div class="footer-nav">
Home Privacy Diversity Policy
</div>
</div>
</div>
</footer>
<!-- #end footer area -->
</body>
</html>
CSS
html, body {
height: 100%; margin: 0; padding: 0;
}
body
{
margin:0;
padding:0;
background: #fff;
font: 13px'helvetica', ariel, sans-serif;
color: #000;
}
/*Header*/
#header
{
position:relative;
width:autopx;
max-width:950px;
height:65px;
margin: 0 auto;
z-index:10000;
background: #fff;
padding:20px;
}
#wrap {min-height: 100%;}
#mainpage {
padding-bottom: 85px;} /* must be same height as the footer */
.footer {position: relative;
margin-top: -85px; /* negative value of footer height */
height: 85px;
clear:both;}
/* nav */
.nav
{
width:autopx;
float:right;
padding-top:22px;
}
ul.simple-toggle
{
list-style:none;
padding: 0px;
margin: 0px;
text-align: center;
}
ul.simple-toggle li {
display: inline-block;
text-align: center;
border-right: 1px solid #cfcfcf;
}
ul.simple-toggle li:last-child
{
border-right: none;
}
ul.simple-toggle li a
{
display: block;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
color:#000;
text-decoration:none;
}
.anchor-link
{
display: none;
background-color: #16447b;
margin-top: -10px;
float: right;
height:40px;
width:40px;
}
.anchor-link img
{
margin:9px 6px 0px 4px ;
}
#mobile-nav
{
display:none;
}
nav ul ul
{
display: none;
}
nav ul li:hover > ul
{
display: table-cell;
text-align: center;
vertical-align: middle;
}
nav ul
{
list-style: none;
position: relative;
display: inline-table;
}
nav ul li:hover
{
background: #16447b;
color: #fff;
}
nav ul li:hover a
{
color: #fff;
}
nav ul ul
{
background: #092a55; padding:0px; margin:0px;
position: inherit; top: 100%;
}
nav ul ul:hover a
{
background: #6689b3;
}
/*wrapper*/
#bg-image {
z-index:-5780000;
float: left;
width: 100%;
height:250px;
background-size:cover;
margin-top:2px;
border: 2px solid #16447b;
border-width: 2px 0;
border-color: #fff;
box-shadow: 0 2px 0px #16447b, 0 -2px 0px #16447b;
}
.wrapper
{
width:90%;
max-width: 910px;
margin: auto;
margin-top:125px;
padding:20px;
background: #fff;
height:150px;
}
#main left{
background-color: #fff;
width: 62.5%;
float: left;
}
#main right
{
background-color:#fff;
width: 35%;
float: right;
}
/*Footer*/
#footer-wrapper
{
height:65px;
margin: 0 auto;
background: #000;
padding:20px;
}
#footer-content
{
height:65px;
max-height:120px;
position:relative;
width:100%;
max-width:950px;
margin: 0 auto;
margin-top:20px;
color: #fff;
}
.Copyright
{
margin-top:5px;
float:left;
color: #fff;
text-decoration:none;
}
.footer-nav
{
margin-top:5px;
float:right;
color: #fff;
text-decoration:none;
margin-right:-6px;
}
.footer-nav a
{
color: #fff;
padding-left:6px;
padding-right:5px;
border-right: 1px solid #fff;
text-decoration:none;
float: left;
}
.footer-nav a:last-child
{
border:none;
}
.footer-nav a:hover
{
text-decoration:underline;
}
.clear {
clear:both;
}
/*media*/
#media (max-width:750px){
ul.simple-toggle
{
display: none;
}
.anchor-link, #mobile-nav
{
display: block;
}
ul.open
{
background-color: #16447b;
display: block;
list-style: none outside none;
margin: 0;
padding: 0;
position: absolute;
right: 20px;
top: 100%;
width: 175px;
z-index: 50000;
opacity:0.90;
}
ul.open ul
{
background-color: #092a55;
display: none;
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
top: 100%;
width: 175px;
z-index: 50000;
}
ul.open li
{
display: block;
list-style: none;
text-align: center;
border: none;
}
ul.open li a
{
display: block;
padding: 10px 5px;
border-bottom: 0px solid #5578a4;
color: #fff;
}
ul.open li a:hover
{
background-color: #375d8f;
color: #fff;
}
.wrapper
{
width:85%;
max-width: 910px;
margin: auto;
margin-top:125px;
padding:20px;
background: #fff;
height:250px;
}
#main left{
background:#fff;
width: 62.5%;
float: left;
}
#main right
{
background:#fff;
width: 35%;
float: right;
}
.Copyright
{
position:absolute;
left:0px;
top:-10px;
font: 11px'helvetica', ariel, sans-serif;
}
.footer-nav
{
position:absolute;
left:-6px;
top:10px;
font: 11px'helvetica', ariel, sans-serif;
}
}
#media (max-width:480px){
img[src*="images/Linear.Partners.Logo.png"]
{
margin-top:13px;
height:40px;
width:106px;
}
.bg-image {
float: left;
width: 100%;
height:150px;
background-size:cover;
}
.wrapper{
width:80%;
height:200px;
margin-top:75px;
}
#main right
{
float: left;
clear: left;
margin: 0 0 10px;
width: 100%;
}
#main left
{
float: left;
clear: left;
margin: 0 0 10px;
width: 100%;
}
.Copyright
{
position:absolute;
left:0px;
top:-10px;
font: 11px'helvetica', ariel, sans-serif;
}
.footer-nav
{
position:absolute;
left:-6px;
top:10px;
font: 11px'helvetica', ariel, sans-serif;
}
}
To avoid the footer to overlap the content add a margin to the content corresponding to the footer's height
.footer-nav{
//...
position:fixed;
bottom;0;
height:50px; // just an example
//...
}
.wrap{
margin-bottom:50px;// same as .footer-nav height
}
FIDDLE
Try this for footer div:-
#footer-wrapper {
background: none repeat scroll 0 0 #000000;
height: 65px;
margin: 0 auto;
padding: 20px;
bottom: 0;/*add from here*/
left: 0;
position: fixed;
width: 100%;/*to here*/
}
Check out this code
it may help youjust wirte the footer tag inside the wrap div
<div id="wrap"> <footer></footer> </div>
It seems that everything alright but you missed somewhere 2 closing DIVs.
Try to add them before
<div class="clear"></div>
http://jsfiddle.net/wF9UL/
My footer will not stay at the bottom of my page.
I tried the sticky footer trick, but no good.
Seems my footer has white space beneath it.
Adjusting height on it has done no good.
Here is the HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<!-- <meta name="viewport" content="width=device-width; initial-scale=1.0"> -->
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
<link rel="stylesheet" type="text/css" href="style3.css" />
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script src="navigation.js"></script>
</head><body>
<div id="top">
<header>
<div id="topLeft">topleft</div>
<nav id="nav-wrap">
<ul id="nav">
<li>Home</li>
<li>Attendees<ul><li>Sub Menu</li><li>Sub Menu</li><li>Sub Menu</li><li>Sub Menu</li></ul></li>
<li>Exhibitors</li>
<li>Speakers</li>
<li>Program</li>
</ul>
</nav>
<div id="topRight">topright</div>
</header>
</div>
<div id="middle">
<div id="headerLeft"></div>
<div id="headerimage">
<img src="header-2013.jpg"/>
</div>
<div id="headerRight"></div>
<br style="clear: left;" />
</div>
<div id="pagewrap">
<div id="content">
<!-- <h3>To see the mobile navigation, narrow your browser window or check with a mobile device.</h3>
<p>Unholy is a new, upcoming raiding guild with goals of
successfully accomplishing Player versus Environment and Player versus Player
raiding content. If thou art seeking such guild then thou would consider joining
us on our quest to victory over the evils that lurk within the depths of
Karazhan and Zul'Aman. All are welcome that have experienced the foul beasts
that roam abroad the forsaken ground in the Outlands and whish to further
explore and cleanse such places. If this should be thy calling then we welcome
you to our quest for victory, For the Horde </p> -->
</div>
</div>
<footer>
<div id="footer">
footer
</div>
</footer>
</body></html>
And here is the CSS:
/************************************************************************************
GENERAL
*************************************************************************************/
html{
height:auto;
}
body {
font: .9em/150% Arial, Helvetica, sans-serif;
color: #666;
overflow-x:hidden;
/******extra Mike Clayton **/
margin: 0;
padding:0;
height:100%;
}
a {
text-decoration: none;
color: #39C;
}
h1, h2 {
line-height: 120%;
margin: 0 0 10px;
color: #000;
}
header {
content: " ";
display: table;
}
/************************************************************************************
STRUCTURE
*************************************************************************************/
#pagewrap {
width: 100%;
max-width:650px;
margin: 0px auto;
/**Mike Clayton**/
min-height:100%;
height:100%;
}
#content {
clear: both;
border-top: solid 1px #ccc;
padding-top: 20px;
margin: 20px 0;
width:100%;
/**Mike clayton**/
/* padding-bottom:250px; */
padding-bottom:55%;
}
#top{
width:100%;
background-color:#002664;
clear:both;
}
#topLeft{
float:left;
background-color:#002664;
width:20%;
margin:0;
}
#topRight{
float:left;
background-color:#002664;
width:20%;
margin:0;
}
#middle{
width:100%;
background-color:#AD1B30;
overflow: hidden;
}
#headerLeft{
float:left;
background-color:#AD1B30;
width:20%;
margin:0;
}
#headerimage{
width:650px;
align:center;
margin:0 auto;
}
#headerimage img{
width:100%;
}
#headerRight{
float:left;
background-color:#AD1B30;
width:20%;
margin:0;
}
#footer{
/* background-color:#002664;
width:100%;
margin-top:-100;
height:150px; */
clear: both;
position: relative;
z-index: 10;
height: 3em;
margin-top: -3em;
background-color:#002664;
width:100%;
margin-top:-100;
}
/************************************************************************************
NAV
*************************************************************************************/
#nav-wrap {
margin-top: 20px;
}
/* menu icon */
#menu-icon {
display: none; /* hide menu icon initially */
}
#nav,
#nav li {
margin: 0;
padding: 0;
}
#nav li {
list-style: none;
float: left;
margin-right: 5px;
}
/* nav link */
#nav a {
padding: 4px 15px;
display: block;
color: #000;
background: #ecebeb;
}
#nav a:hover {
background: #f8f8f8;
}
/* nav dropdown */
#nav ul {
background: #fff;
padding: 2px;
position: absolute;
border: solid 1px #ccc;
display: none; /* hide dropdown */
width: 200px;
}
#nav ul li {
float: none;
margin: 0;
padding: 0;
}
#nav li:hover > ul {
display: block; /* show dropdown on hover */
}
/************************************************************************************
MOBILE
*************************************************************************************/
#media screen and (max-width: 600px) {
/* nav-wrap */
#nav-wrap {
position: relative;
}
/* menu icon */
#menu-icon {
color: #000;
width: 42px;
height: 30px;
background: #ecebeb url(menu-icon.png) no-repeat 10px center;
padding: 8px 10px 0 42px;
cursor: pointer;
border: solid 1px #666;
display: block; /* show menu icon */
}
#menu-icon:hover {
background-color: #f8f8f8;
}
#menu-icon.active {
background-color: #bbb;
}
/* main nav */
#nav {
clear: both;
position: absolute;
top: 38px;
width: 160px;
z-index: 10000;
padding: 5px;
background: #f8f8f8;
border: solid 1px #999;
display: none; /* visibility will be toggled with jquery */
}
#nav li {
clear: both;
float: none;
margin: 5px 0 5px 10px;
}
#nav a,
#nav ul a {
font: inherit;
background: none;
display: inline;
padding: 0;
color: #666;
border: none;
}
#nav a:hover,
#nav ul a:hover {
background: none;
color: #000;
}
/* dropdown */
#nav ul {
width: auto;
position: static;
display: block;
border: none;
background: inherit;
}
#nav ul li {
margin: 3px 0 3px 15px;
}
#headerimage {
display: none;
}
}
#media screen and (min-width: 600px) {
/* ensure #nav is visible on desktop version */
#nav {
display: block !important;
}
}
So, that last post from Kakarott worked.
Also, I used position:relative for my Media Query mobile dev and it made that same CSS work for my Mobile site.
So, for desktop and tablet, I'm using position:absolute and for mobile:relative.
FYI, I'm using a responsive design.
Check this
http://code.google.com/p/cleanstickyfooter/
and the best solution
http://www.cssstickyfooter.com/
Change your footer css to:
#footer{
clear: both;
position: absolute;
z-index: 10;
height: 3em;
bottom:0;
background-color:#002664;
width:100%;
}
I struggle with working with Internet Explorer.
Issue one:
I have used min-height:100% and I no that this does not work in IE. How could I set the "min-height" in my css?
Issue two:
I have used
position: relative;
z-index:50000;`
for my header and now its not aligned where it is required.
I have shiv installed
The link to the site is http://buddywalknz.org
HTML (With CMS Tags)
<!DOCTYPE html>
<head>
{pyro:theme:partial name="metadata"}
<body>
<header>
<div id="logo"></div>
</header>
<nav>
<ul>
{pyro:navigation:links group="header" indent="tab"}
</ul>
</nav>
<div id="mainContent">
{if ('{pyro:page:is_home}' == TRUE)}
<h1>Welcome</h1>
{else}
<h1>{pyro:page:title}</h1>
{/if}
<p>
{pyro:page:body}
</p>
<div id="gallery">
<div id="galleryMain"><img src="http://buddywalknz.org/uploads/default/files/accouncil_s.jpg" width="375" height="149" title="Proudly Supported by Auckland Council" alt="Auckland Council"></div>
{pyro:streams:cycle stream="sponsors"}
{entries}
<div class="galleryLogo"><img src="{company_logo.thumb}" title="Proudly Supported by {company_name}" alt="{company_name}"></div>
{/entries}
{/pyro:streams:cycle}
</div>
</div><!-- Main Content Close -->
</body>
</html>
CSS:
html{
background: url('../img/Body_BG.png') repeat-x 0 0 scroll;
background-color:#0C0C0C;
height:100%;
width:100%;
}
body{
width:960px;
height:100%;
min-height: 100% !important;
margin: 0 auto;
font-family:Verdana, Geneva, sans-serif;
}
h1{
margin:25px 0 0 25px;
font-family: 'Quicksand', sans-serif;
font-size:30px;
}
header{
height: 219px;
width: 551px;
margin:0 auto;
}
header #logo{
background:url('../img/logo.png') no-repeat scroll 0 0 transparent;
width:551px;
height:219px;
position: relative;
z-index:50000;
}
nav{
background:url('../img/navBG.png') no-repeat;
float:right;
width:135px;
height:100%;
padding:30px 0 0 0;
}
nav ul{
list-style:none;
margin:15px 0 0 0;
}
nav li{
margin:10px 0 0 -30px;
text-align:left;
text-indent:5px;
}
nav li a{
text-decoration:none;
color:#ff9f30;
font-family: 'Quicksand', sans-serif;
}
#mainContent{
float:right;
background:url('../img/mainBG.png') no-repeat;
width:707px;
height:auto;
min-height:100%;
margin:-35px auto;
}
#mainContent h1{
font-family: 'Quicksand', sans-serif;
}
#mainContent a{
color:#ff9f30;
font-weight:bold;
text-decoration: none;
}
#bottomBanner{
background: url('../img/bottomBanner.png') no-repeat;
width:478px;
height: 47px;
margin: -47px 0 0 300px;
}
#mainContent p{
margin:0 30px 0 30px;
font-size: 13px;
text-align:justify;
}
#Video{
margin: 30px 0 0 150px;
}
#Video #Vid{
border: 5px solid #4e2b97;
}
.img{
border: 5px solid #ff9f30;
}
a {
outline: none;
}
a img {
border: 1px solid #BBB;
padding: 2px;
margin: 10px 20px 10px 0;
vertical-align: top;
}
a img.last {
margin-right: 0;
}
ul {
margin-bottom: 24px;
padding-left: 30px;
}
#img{
margin-left: 25px;
}
#map{
margin:0 0 0 115px;
}
/* Sponsor Gallery CSS */
#gallery{
width:707px;
min-height: 100% !important;
margin:0 0 0 30px;
}
#galleryMain{
margin:0 0 0 150px;
}
.galleryLogo{
float:left;
width:200px;
height:200px;
margin:0 8px 5px 0;
}
#galleryLogo img{
border:none;
}
#galleryLogo a{
border:none;
text-decoration: none;
}
/* End Sponsor Gallery CSS */
#contact-form{
width:350px;
margin:10px auto;
}
#contact-form label{
float:left;
width:175px;
}
#contact-form input{
width:175px;
}
min-height does work in IE7 and later, but does not work in IE6. Since IE6's usage is minimal, you should consider just ignoring it.
You have this code:
<!--[if lt IE 8]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Get rid if the first block, you only need the second. This is what includes two copies of html5shim in IE7.
It's a barbaric -- and probably outdated -- solution, but IE does respect image bounds. Create a 1x1-px transparent GIF or PNG, stick it in your space with a height.
This will give you one pixel of shim too (call it leading if you want to be fancy) so make sure you adjust your CSS around that.