I am trying to get my sub-menu to appear above my body div when hovering over menu. Here is a picture of my problem since the website is not live yet.
I have been messing around with this for a while now and can't seem to figure out what I have to do to get it to work. I have a z-index value for my sub menu but it still won't show. How can I get the menu to show above the body div?
#charset "utf-8";
/* Simple fluid media
Note: Fluid media requires that you remove the media's height and width attributes from the HTML
http://www.alistapart.com/articles/fluid-images/
*/
img, object, embed, video {
max-width: 100%;
}
/* IE 6 does not support max-width so default to width 100% */
.ie6 img {
width:100%;
}
/*
Dreamweaver Fluid Grid Properties
----------------------------------
dw-num-cols-mobile: 4;
dw-num-cols-tablet: 8;
dw-num-cols-desktop: 12;
dw-gutter-percentage: 25;
Inspiration from "Responsive Web Design" by Ethan Marcotte
http://www.alistapart.com/articles/responsive-web-design
and Golden Grid System by Joni Korpi
http://goldengridsystem.com/
*/
.fluid {
clear: both;
margin-left: 0;
width: 100%;
float: left;
display: block;
}
.fluidList {
list-style:none;
list-style-image:none;
margin:0;
padding:0;
}
.clearfix:after
{
display: block;
clear: both;
}
.menu
{
width: 300px;
margin: auto;
padding: 0px;
padding-top: 10px;
position: absolute;
margin-left: 0px;
top: 0;
}
.menu li
{
margin: 0px;
list-style: none;
font-size: 0px;
}
.menu a
{
transition: all linear 0.15s;
font-size: 28px;
color: black;
text-decoration: none;
}
.menu li:hover > a, .menu .current-item > a
{
text-decoration: none;
}
.menu .arrow
{
font-size: 20px;
line-height: 0%;
}
.menu > ul > li
{
float :left;
display: inline-block;
position: relative;
font-size: 19px;
}
.menu > ul > li > a
{
padding: 10px 40px;
display: inline-block;
text-shadow: 0px 1px 0px rgba(0,0,0,0.4);
}
.menu > ul > li:hover > a, .menu > ul > .current-item > a
{
color: blue;
}
.sub-menu
{
width: 350px;
padding: 5px 0px;
position: relative;
z-index: 999;
opacity: 0;
box-shadow: 0px 2px 3px rgba(0,0,0,0.2);
}
.menu li:hover .sub-menu
{
opacity: 1;
}
.sub-menu li a
{
padding: 10px 50px;
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
color: black;
background-color: red;
}
.sub-menu li a:hover, .sub-menu .current-item a
{
color: blue;
}
.sub-menu ul li :hover ul
{
}
.gridContainer
{
width: 88.5%;
max-width: 1232px;
padding-left: 0.75%;
padding-right: 0.75%;
margin: auto;
clear: none;
float: none;
margin-left: auto;
}
.zeroMargin_desktop
{
margin-left: 0;
}
.hide_desktop
{
display: none;
}
#body
{
margin-left: auto;
margin-right: auto;
width: auto;
color: black;
}
#container
{
border-top-style: solid;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-color: #00008B;
border-bottom-color: #00008B;
border-right-color: #00008B;
border-left-color: #00008B;
width: 968px;
background: #FFF;
margin: auto;
margin-top: 0px;
margin-bottom: 0px;
position: relative;
padding: 0px;
overflow: hidden;
}
#header
{
background-color: #EBC79E;
width: auto;
position: relative;
height: 100px;
margin: auto;
margin-top: 0px;
overflow: hidden;
}
#logo
{
width: 350px;
margin:auto;
height: auto;
padding: 0px;
padding-top: 20px;
padding-bottom: 10px;
text-align: center;
}
#logo h1
{
font-size: 55px;
}
#logo h1 a
{
list-style-type: none;
color: #000000;
text-decoration: none;
}
#footer
{
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
width: auto;
margin: auto;
background-color: #EBC79E;
position:relative;
border-top-style: solid;
border-top-color: #000;
overflow: hidden;
}
#footer p
{
padding-left: 35px;
}
#homeBody
{
border-top-style: solid;
border-top-color: #000;
width: auto;
margin: auto;
margin-bottom: -20px;
background-color: #FFF;
padding-top: 20px;
padding-bottom: 20px;
padding-left: 20px;
background-color: #CDCDB4;
position: relative;
}
#homeBody h1
{
text-align: center;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 35px;
}
#homeBody h2
{
text-align: center;
font-size: 28px;
font-family: Arial, Helvetica, sans-serif;
}
#homeBody p
{
padding-top: 20px;
margin-right: 25px;
margin-left: 25px;
font-size: 24px;
font-family: Arial, Helvetica, sans-serif;
}
#homeBody img
{
padding-top: 20px;
padding-bottom: 20px;
display: block;
margin-left: auto;
margin-right: auto;
}
<body bgcolor="#87CEFA">
<div id="container">
<div id="header">
<div id="logo">
<h1> New Eve Inc.</h1>
</div>
<nav class="menu">
<ul class="clearfix">
<li>
Menu <span class="arrow">▼</span>
<ul class="sub-menu">
<li>Home<br>
About<br>
Bag Sealing<br>
Club Packaging<br>
Displays<br>
Warehousing & Distribution<br>
Contact Us
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div id="homeBody">
<h1>New Eve Inc.</h1>
<h2>Your Partner in Fulfillment Every Step of the Way</h2>
<p>New Eve has the knowledge and expertise to provide you with the most cost-effective packaging, warehousing, and frieght solutions for your product. We understand that your product is unique, with its own market identity, packaging needs, and delivery
requirements. This is why we offer solutions that will bring your product to market quickly and more profitably.
</p>
<img src="images/high view.jpg" alt="Building">
</div>
<div id="footer">
<p> New Eve Inc. <br> 100 Enterprise Drive Carbondale PA, 18407</p>
</div>
</div>
</body>
</html>
Just change overflow: hidden to overflow: visible in #header
#charset "utf-8";
/* Simple fluid media
Note: Fluid media requires that you remove the media's height and width attributes from the HTML
http://www.alistapart.com/articles/fluid-images/
*/
img, object, embed, video {
max-width: 100%;
}
/* IE 6 does not support max-width so default to width 100% */
.ie6 img {
width:100%;
}
/*
Dreamweaver Fluid Grid Properties
----------------------------------
dw-num-cols-mobile: 4;
dw-num-cols-tablet: 8;
dw-num-cols-desktop: 12;
dw-gutter-percentage: 25;
Inspiration from "Responsive Web Design" by Ethan Marcotte
http://www.alistapart.com/articles/responsive-web-design
and Golden Grid System by Joni Korpi
http://goldengridsystem.com/
*/
.fluid {
clear: both;
margin-left: 0;
width: 100%;
float: left;
display: block;
}
.fluidList {
list-style:none;
list-style-image:none;
margin:0;
padding:0;
}
.clearfix:after
{
display: block;
clear: both;
}
.menu
{
width: 300px;
margin: auto;
padding: 0px;
padding-top: 10px;
position: absolute;
margin-left: 0px;
top: 0;
}
.menu li
{
margin: 0px;
list-style: none;
font-size: 0px;
}
.menu a
{
transition: all linear 0.15s;
font-size: 28px;
color: black;
text-decoration: none;
}
.menu li:hover > a, .menu .current-item > a
{
text-decoration: none;
}
.menu .arrow
{
font-size: 20px;
line-height: 0%;
}
.menu > ul > li
{
float :left;
display: inline-block;
position: relative;
font-size: 19px;
}
.menu > ul > li > a
{
padding: 10px 40px;
display: inline-block;
text-shadow: 0px 1px 0px rgba(0,0,0,0.4);
}
.menu > ul > li:hover > a, .menu > ul > .current-item > a
{
color: blue;
}
.sub-menu
{
width: 350px;
padding: 5px 0px;
position: relative;
z-index: 999;
opacity: 0;
box-shadow: 0px 2px 3px rgba(0,0,0,0.2);
}
.menu li:hover .sub-menu
{
opacity: 1;
}
.sub-menu li a
{
padding: 10px 50px;
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
color: black;
background-color: red;
}
.sub-menu li a:hover, .sub-menu .current-item a
{
color: blue;
}
.sub-menu ul li :hover ul
{
}
.gridContainer
{
width: 88.5%;
max-width: 1232px;
padding-left: 0.75%;
padding-right: 0.75%;
margin: auto;
clear: none;
float: none;
margin-left: auto;
}
.zeroMargin_desktop
{
margin-left: 0;
}
.hide_desktop
{
display: none;
}
#body
{
margin-left: auto;
margin-right: auto;
width: auto;
color: black;
}
#container
{
border-top-style: solid;
border-right-style: solid;
border-left-style: solid;
border-bottom-style: solid;
border-top-color: #00008B;
border-bottom-color: #00008B;
border-right-color: #00008B;
border-left-color: #00008B;
width: 968px;
background: #FFF;
margin: auto;
margin-top: 0px;
margin-bottom: 0px;
position: relative;
padding: 0px;
overflow: hidden;
}
#header
{
background-color: #EBC79E;
width: auto;
position: relative;
height: 100px;
margin: auto;
margin-top: 0px;
overflow: visible;
}
#logo
{
width: 350px;
margin:auto;
height: auto;
padding: 0px;
padding-top: 20px;
padding-bottom: 10px;
text-align: center;
}
#logo h1
{
font-size: 55px;
}
#logo h1 a
{
list-style-type: none;
color: #000000;
text-decoration: none;
}
#footer
{
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
width: auto;
margin: auto;
background-color: #EBC79E;
position:relative;
border-top-style: solid;
border-top-color: #000;
overflow: hidden;
}
#footer p
{
padding-left: 35px;
}
#homeBody
{
border-top-style: solid;
border-top-color: #000;
width: auto;
margin: auto;
margin-bottom: -20px;
background-color: #FFF;
padding-top: 20px;
padding-bottom: 20px;
padding-left: 20px;
background-color: #CDCDB4;
position: relative;
}
#homeBody h1
{
text-align: center;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 35px;
}
#homeBody h2
{
text-align: center;
font-size: 28px;
font-family: Arial, Helvetica, sans-serif;
}
#homeBody p
{
padding-top: 20px;
margin-right: 25px;
margin-left: 25px;
font-size: 24px;
font-family: Arial, Helvetica, sans-serif;
}
#homeBody img
{
padding-top: 20px;
padding-bottom: 20px;
display: block;
margin-left: auto;
margin-right: auto;
}
<body bgcolor="#87CEFA">
<div id="container">
<div id="header">
<div id="logo">
<h1> New Eve Inc.</h1>
</div>
<nav class="menu">
<ul class="clearfix">
<li>
Menu <span class="arrow">▼</span>
<ul class="sub-menu">
<li>Home<br>
About<br>
Bag Sealing<br>
Club Packaging<br>
Displays<br>
Warehousing & Distribution<br>
Contact Us
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div id="homeBody">
<h1>New Eve Inc.</h1>
<h2>Your Partner in Fulfillment Every Step of the Way</h2>
<p>New Eve has the knowledge and expertise to provide you with the most cost-effective packaging, warehousing, and frieght solutions for your product. We understand that your product is unique, with its own market identity, packaging needs, and delivery
requirements. This is why we offer solutions that will bring your product to market quickly and more profitably.
</p>
<img src="images/high view.jpg" alt="Building">
</div>
<div id="footer">
<p> New Eve Inc. <br> 100 Enterprise Drive Carbondale PA, 18407</p>
</div>
</div>
</body>
</html>
Related
The navbar I created overlaps when I switch my site to a mobile view.
I tried making it fit-content, but it still overlaps. The part that overlaps is the listed items
#navBar {
overflow: hidden;
text-align: center;
border-top: double black 2px;
}
#navBar ul {
padding: 0;
list-style: none;
width: fit-content;
}
#navBar li {
display: inline;
padding-top: 23px;
position: relative;
}
#navBar a {
font-size: 20px;
padding-right: 20px;
text-decoration: none;
text-align: center;
border: 4px solid lime;
padding-bottom: 10px;
padding-top: 20px;
padding-left: 10px;
font-family: American Typewriter, serif;
color: #262626;
text-transform: uppercase;
border-radius: 0px 0px 25px 25px;
}
#navBar a:hover {
color: lime;
}
#navBar a::before {
content: '';
display: block;
height: 5px;
width: 100%;
background-color: lime;
position: absolute;
top: 0;
width: 0%;
transition: all ease-in-out 250ms;
}
#navBar::hover::before {
width: 100%;
}
<nav id="navBar">
<div class="bar">
<ul>
<li>Tab1</li>
<li>Tab2 </li>
<li> Tab3</li>
</ul>
</div>
</nav>
I expect the navbar items to be side by side but the actual result in them overlapping.
You can use inline-flex for that
change
#navBar ul {
padding: 0;
margin: 0; /* reset margin */
list-style: none;
width: fit-content;
}
#navBar li {
display: inline-flex; /* change to inline-flex and remove the padding */
position: relative;
}
#navBar {
overflow: hidden;
text-align: center;
border-top: double black 2px;
}
#navBar ul {
padding: 0;
margin: 0;
list-style: none;
width: fit-content;
}
#navBar li {
display: inline-flex;
position: relative;
}
#navBar a {
font-size: 20px;
padding-right: 20px;
text-decoration: none;
text-align: center;
border: 4px solid lime;
padding-bottom: 10px;
padding-top: 20px;
padding-left: 10px;
font-family: American Typewriter, serif;
color: #262626;
text-transform: uppercase;
border-radius: 0px 0px 25px 25px;
}
#navBar a:hover {
color: lime;
}
#navBar a::before {
content: '';
display: block;
height: 5px;
width: 100%;
background-color: lime;
position: absolute;
top: 0;
width: 0%;
transition: all ease-in-out 250ms;
}
#navBar::hover::before {
width: 100%;
}
<nav id="navBar">
<div class="bar">
<ul>
<li>Tab1</li>
<li>Tab2 </li>
<li> Tab3</li>
</ul>
</div>
</nav>
I'm having some troubles to align the upper_navdiv with the content div.
I want the upper_nav with links aligned with the right-hand side margin and that grows in the left-hand side direction depending on how many links there are inside and the width of each boxes.
Could you check which is the problem?
upper_nav is child of header that takes the whole width of the page:
div#upper_nav {
position: absolute;
bottom:0;
right:0;
width:80%;
}
So I would that the width would be the 80% of the parent width but I don't understand why the margin is not aligned correctly.
Here the example of my page:
html {
margin: 0;
padding: 0;
background-color: #ffffff;
font-size: 17px;
}
body {
font-family: Tahoma, Geneva, sans-serif;
color: #000;
text-align: justify;
background-image: url('url_immagine');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
div#container {
overflow: hidden;
width: 95%;
margin: 0px auto;
background-color: #ffffff;
}
div#header {
/*background: url('header.png') no-repeat center center;*/
/*background-size: cover;*/
/*height:18vw;*/
position: relative;
}
div#upper_nav {
position: absolute;
bottom: 0;
right: 0;
width: 80%;
/*background-color:#e6e6e6;*/
}
div#navigation_left {
padding: 1% 1%;
float: left;
width: 21%;
background-color: #e6e6e6;
box-shadow: 5px 5px 2px #888888;
padding-bottom: 99999px;
margin-bottom: -99999px;
}
div#content {
overflow: auto;
margin-left: 25%;
background-color: #e6e6e6;
box-shadow: 5px 5px 2px #888888;
padding-left: 1%;
padding-right: 1%;
padding-bottom: 99999px;
margin-bottom: -99999px;
}
div#footer {
clear: both;
/*background: url('footer.png') no-repeat center center;*/
/*background-size: cover;*/
/*height:5vw;*/
width: 100%;
position: relative;
}
div#footer_content {
position: relative;
bottom: -50%;
text-align: center;
z-index: 9999;
background-color: #e6e6e6;
}
P {
color: #000;
font-family: Tahoma;
}
a {
text-decoration: none;
color: #0066FF;
font-size: 17px;
}
a:hover {
color: #0066FF;
text-decoration: underline
}
h1 {
background-color: #737373;
color: #fff;
font-family: verdana;
font-size: 200%;
}
h2,
h3,
h4,
h5,
h6,
h7,
h8 {
background-color: #737373;
color: #fff;
font-family: verdana;
font-size: 150%;
}
ul#menu_header {
list-style: none;
line-height: 150%;
text-align: center;
}
ul#menu_header li {
background-color: #737373;
right: 0;
width: 19.6%;
margin: 0.2%;
float: left;
/* elementi su singola riga */
}
ul#menu_header li a {
color: #fff;
text-decoration: none;
}
ul#menu_header li.active,
ul#menu_header li:hover {
background-color: #b1b1b1;
}
ul#menu_left {
display: block;
list-style: none;
text-align: left;
text-decoration: none;
padding-left: 5%;
}
ul#menu_left li {
margin: 1%;
font-size: 5vw;
}
ul#menu_left li a {
color: #000;
display: block;
line-height: 150%;
text-decoration: none;
}
ul#menu_left li.active,
ul#menu_left li:hover {
background-color: #c9c9c9;
}
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
transition: 0.4s;
}
.active,
.accordion:hover {
background-color: #ccc;
}
.panel {
padding: 0 18px;
display: none;
background-color: white;
overflow: hidden;
}
.panel a {
color: #000
}
.panel a:hover {
background-color: #b1b1b1
}
<html>
<head>
<title>Title</title>
</head>
<body>
<div id="container">
<div id="header">
<img src="http://placehold.it/1600x900" width="100%" alt="Riunione annuale GTTI SIEm2019" />
<div id="upper_nav">
<ul id="menu_header">
<li class="active">Home</li>
<li>Link11</li>
<li>Link22</li>
<li>Link33</li>
<li>Link44</li>
</ul>
</div>
</div>
<div id="navigation_left">
<ul id="menu_left">links</ul>
</div>
<div id="content">
<p>text</p>
</div>
<div id="footer">
<div id="footer_content"></div>
</div>
</div>
</body>
</html>
You notice the non-alignment resizing the window.
This is a simple dropdown navigation menu. The problem here that the dropdown menu doesn't appear if i don't give it a fixed height. Is there a way to make it appear without giving it a fixed height? And if there any other modifications or ameliorations that can be useful please tell me. Thank you.
HTML:
<nav>
<ul class="mainmenu">
<li>Browsers
<div class="submenubig">
<div class="submenusmall Browsers">
<ul>
<li><span>Top Browsers</span>
<ul class="topbrowsers">
<li>Firefox</li>
<li>Chrome</li>
<li>Safari</li>
<li>Opera</li>
<li>Edge</li>
</ul>
</li>
<li><span>Other Browsers</span>
<ul class="otherbrowsers">
<li>Dooble</li>
<li>Coowon</li>
<li>Blackhawk</li>
<li>Beamrise</li>
<li>NetGroove</li>
</ul>
</li>
</ul>
</div>
</div>
</li>
</ul>
</nav>
CSS:
*{
box-sizing: border-box;
font-family: Arial;
}
nav{
border: 5px solid orange;
height: 1000px;
}
ul{
list-style: none;
padding: 0;
}
.mainmenu{
margin: 20px auto;
display: table;
width: 1000px;
position: relative;
background-color: #1E1E1E;
}
.mainmenu > li{
display: table-cell;
}
a{
display: block;
width: 100%;
height: 100%;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
.mainmenu > li > a{
font-size: 1.3em;
padding: 0;
color: white;
letter-spacing: 0.1em;
}
.mainmenu > li > a:hover{
color: aqua;
}
.mainmenu > li:hover .submenubig{
border-bottom: 5px solid yellow;
max-height: 1000px;
}
.submenubig{
overflow: hidden;
position: absolute;
left: 0;
width: 100%;
transition: 0.2s all ease-in;
max-height: 0px;
background: #555;
}
.submenusmall a:hover{
color: yellow;
text-decoration: underline;
}
/*--------------------------------------------------*/
span{
font-size: 1.3em;
display: block;
text-align: center;
color: burlywood;
letter-spacing: 0.1em;
}
.submenusmall{
padding-top: 20px;
padding-left: 60px;
}
.submenusmall a{
color: white;
font-size: 1.1em;
letter-spacing: 0.1em;
}
.submenusmall > ul{
height: 190px;
/*This is what i'm talking about*/
}
.submenusmall > ul > li{
position: relative;
float: left;
padding: 0 10px;
color: white;
margin-right: 90px;
text-transform: uppercase;
letter-spacing: 0.1em;
}
.topbrowsers{
position: absolute;
left: 0;
width: 100%;
top: 45px;
padding: 0;
}
.topbrowsers li{
display: block;
width: 100%;
border-bottom: 1px solid grey;
}
.otherbrowsers{
position: absolute;
width: 100%;
left: 0;
top: 45px;
padding: 0;
}
.otherbrowsers li{
display: block;
width: 100%;
border-bottom: 1px solid grey;
}
I think the problem is that the unordered lists with the .topbrowsers and .otherbrowsers classes are set with position absolute:
The element is removed from the normal document flow; no space is
created for the element in the page layout.
You could try this:
*{
box-sizing: border-box;
font-family: Arial;
}
nav{
border: 5px solid orange;
height: 1000px;
}
ul{
list-style: none;
padding: 0;
}
.mainmenu{
margin: 20px auto;
display: table;
width: 1000px;
position: relative;
background-color: #1E1E1E;
}
.mainmenu > li{
display: table-cell;
}
a{
display: block;
width: 100%;
height: 100%;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
.mainmenu > li > a{
font-size: 1.3em;
padding: 0;
color: white;
letter-spacing: 0.1em;
}
.mainmenu > li > a:hover{
color: aqua;
}
.mainmenu > li:hover .submenubig{
border-bottom: 5px solid yellow;
max-height: 1000px;
}
.submenubig{
overflow: hidden;
position: absolute;
left: 0;
width: 100%;
transition: 0.2s all ease-in;
max-height: 0px;
background: #555;
}
.submenusmall a:hover{
color: yellow;
text-decoration: underline;
}
/*--------------------------------------------------*/
span{
font-size: 1.3em;
display: block;
text-align: center;
color: burlywood;
letter-spacing: 0.1em;
}
.submenusmall{
padding-top: 20px;
padding-left: 60px;
}
.submenusmall a{
color: white;
font-size: 1.1em;
letter-spacing: 0.1em;
}
.submenusmall > ul{
// height: 190px;
/*This is what i'm talking about*/
}
.submenusmall > ul > li{
position: relative;
float: left;
padding: 0 10px;
color: white;
margin-right: 90px;
text-transform: uppercase;
letter-spacing: 0.1em;
}
.topbrowsers{
// position: absolute;
// left: 0;
width: 100%;
// top: 45px;
padding: 30px 0;
}
.topbrowsers li{
display: block;
width: 100%;
border-bottom: 1px solid grey;
}
.otherbrowsers{
// position: absolute;
width: 100%;
// left: 0;
// top: 45px;
padding: 30px 0;
}
.otherbrowsers li{
display: block;
width: 100%;
border-bottom: 1px solid grey;
}
I am trying to display a facebook like box on the sidebar of my website. Yet when I put the code in, nothing appears. I have tried moiving the code to different spots and still nothing appears. I am not sure what I am doing wrong. Thanks in advance. Here is the code.
<!DOCTYPE html>
<!-- Website template by freewebsitetemplates.com -->
<html>
<head>
<meta charset="UTF-8">
<title>Kustum Kostumes</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.8";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="page">
<div id="header">
<div class="background">
<h1 id="logo"> <img src="images/Banner1.jpg" alt="Logo" /> </h1>
<div id="navigation">
<ul>
<li class="selected">
<li>
Home
</li>
<li>
Services
</li>
<li>
Gallery
</li>
</ul>
</div>
</div>
</div>
<div id="contents">
<div id="blog">
<div id="sidebar">
<div class="section">
<div class="fb-page" data-href="https://www.facebook.com/kustumkostumes" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="https://www.facebook.com/kustumkostumes" class="fb-xfbml-parse-ignore">Kustum Kostumes</blockquote></div>
<ul class="posts">
<li>
<span class="time">.</a>
</li>
<li>
<span class="time"></a>
</li>
<li>
<span class="time"></a>
</li>
</ul>
</div>
<div class="section">
<h5></h5>
<ul>
</ul>
</div>
</div>
<div id="main">
<h3>Welcome to Kustum Kostumes</h3>
<p> We aim to provide high quality, handmade and crafted kostumes, props, sculptures, and artwork!<br> We put in a lot of time and effort into what we produce to make sure that not only is the client <br>happy but it looks as close as possible to the source material. </p><p>Please check out the services page to see a detailed list of what we have to offer <br>and the approximate prices for each. Please use the Gumtree links on the side <br>for what we currently have for sale. Alternatively, contact us for anything you have in mind.<br> Don't forget to like us on facebook for continual updates.
</p>
<img src="images/bg-header2.jpg" alt="Img" height="325" width="547">
</div>
<div class="footer">
</div>
</div>
</div>
<div id="footer">
<div class="background">
<div class="body">
<form action="contact.php" method="post" id="message" class="section">
<h3>Send a Message</h3>
<ul>
<li>
<label>Full Name:</label>
<input type="text" value="">
</li>
<li>
<label>Email:</label>
<input type="text" value="">
</li>
<li>
<label>Message:</label>
<textarea></textarea>
</li>
<li>
<input type="submit" value="Send">
</li>
</ul>
</form>
<div class="section">
<h3>Contact Us</h3>
<ul>
<li>
<span>Phone</span><strong>:</strong>
<p>
0450101551
</p>
</li>
<li>
<span>Email</span><strong>:</strong>
<p>
kustumkostumes#gmail.com
</p>
</li>
<li>
<span>
</li>
</ul>
</div>
<p id="footnote">
© Copyright 2017. All rights reserved. ABN 78 820 831 193
</p>
</div>
</div>
</div>
</div>
CSS Stylesheet
/* Website template by freewebsitetemplates.com */
#font-face {
font-family: 'DaysOne-Regular';
src: url('../fonts/DaysOne-Regular.eot');
src: local('☺'), url('../fonts/DaysOne-Regular.woff') format('woff'), url('../fonts/DaysOne-Regular.ttf') format('truetype'), url('../fonts/DaysOne- Regular.svg') format('svg');
font-weight: normal;
font-style: normal;
}
body {
background: url(../images/bg-body.jpg) repeat left top;
font-family: Arial, Helvetica, sans-serif;
min-width: 960px;
margin: 0;
}
.background {
background: url(../images/bg-pattern-red.jpg) repeat left top;
}
#page {
width: 960px;
margin: 0 auto;
padding: 156px 0 0;
}
img {
border: 0;
}
/*------------------------------ SPRITES ------------------------------*/
#footer ul li a {
background: url(../images/icons.png) no-repeat;
}
#message input[type='submit'], .more {
background: url(../images/bg-buttons.png) no-repeat;
}
.more {
background-position: 0 -35px;
color: #636974;
display: inline-block;
font-size: 14px;
font-weight: bold;
height: 35px;
line-height: 35px;
width: 170px;
padding: 1px 0;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
.more:hover {
background-position: 0 -82px;
color: #010000;
}
/*------------------------------ HEADER ------------------------------*/
#header {
width: 100%;
border-bottom: 5px solid #c3c3c3;
position: absolute;
left: 0;
top: 0;
}
#header .background {
height: 150px;
border-bottom: 1px solid #b6051c;
}
/** Logo **/
#logo {
font-family: 'DaysOne-Regular';
font-size: 36px;
font-weight: normal;
line-height: 130px;
width: 960px;
margin: 0 auto;
}
#logo a {
color: #fff;
text-decoration: none;
text-transform: uppercase;
}
/** Navigation **/
#navigation {
background: url(../images/bg-navigation.png) no-repeat;
height: 49px;
width: 960px;
margin: 0 auto;
position: relative;
top: 0;
}
#navigation ul {
display: inline-block;
list-style: none;
margin: 0;
padding: 1px 10px;
}
#navigation li {
float: left;
}
#navigation li a {
color: #636974;
display: block;
font-size: 14px;
font-weight: bold;
line-height: 47px;
width: 154px;
border-color: transparent;
border-style: none solid;
border-width: 1px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
#navigation li a:hover, #navigation li.selected a {
background-color: #bebcbc;
color: #2e3a54;
border-color: #afafaf;
}
/*------------------------------ CONTENTS ------------------------------*/
#contents {
background: #fff url(../images/bg-content-bottom.png) no-repeat left bottom;
display: inline-block;
width: 100%;
margin-bottom: 30px;
padding: 23px 0 0;
-webkit-border-bottom-right-radius: 1px;
-webkit-border-bottom-left-radius: 1px;
-moz-border-radius-bottomright: 1px;
-moz-border-radius-bottomleft: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
}
#contents h1, #contents h2, #contents h4, #contents h5, #contents h6 {
color: #2e3a54;
font-family: "DaysOne-Regular";
font-size: 36px;
font-weight: normal;
margin: 0 0 18px;
}
#contents h2 {
font-size: 24px;
line-height: 24px;
text-transform: uppercase;
}
#contents h4 {
font-size: 16px;
line-height: 24px;
margin: 0 0 12px;
text-transform: uppercase;
}
#contents h5 {
font-size: 14px;
line-height: 24px;
margin: 0;
text-transform: uppercase;
}
#contents h5 a {
color: #940315;
text-decoration: none;
}
#contents h6 {
font-size: 12px;
line-height: 24px;
text-transform: uppercase;
}
#contents p {
color: #636974;
font-size: 14px;
line-height: 24px;
margin: 0;
padding: 0 0 24px;
}
#contents p a {
color: #636974;
}
#contents p a:hover {
color: #721f29;
}
#contents h5 a:hover {
text-decoration: underline;
}
#contents .footer {
background-color: #f8f8f8;
clear: both;
width: 900px;
margin: 0 0 4px -30px;
padding: 20px 30px 0;
}
#contents .footer h6 {
float: left;
width: 210px;
margin-bottom: 30px;
margin-right: 20px;
text-transform: uppercase;
}
#contents .section {
width: 260px;
padding: 0 0 0 20px;
}
#contents > div:first-child {
padding: 48px 30px 24px;
}
.time {
color: #636974;
display: block;
font-size: 12px;
line-height: 12px;
padding: 6px 0 5px;
}
/** adbox **/
#contents #adbox {
background: url(../images/bg-adbox-bottom.png) no-repeat left bottom;
padding: 0 0 19px;
position: relative;
}
#adbox > div {
background-color: #f0f0f0;
height: 390px;
-webkit-border-bottom-right-radius: 1px;
-webkit-border-bottom-left-radius: 1px;
-moz-border-radius-bottomright: 1px;
-moz-border-radius-bottomleft: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
padding-right: 20px;
}
#adbox > div:after {
clear:both;
content:"";
display:block;
height:1%;
line-height:0;
visibility:hidden;
}
#adbox h1 {
padding-top: 18px;
}
#adbox h4 {
font-size: 14px;
}
#adbox img {
float: left;
margin-right: 20px;
}
/** Sidebar **/
#contents .sidebar {
float: left;
min-height: 490px;
width: 279px;
border-right: 1px solid #f2cc3d;
margin: -19px 40px 0 30px;
padding: 20px 0 0;
}
#contents .sidebar ul {
list-style: none;
margin: 0;
padding: 0;
}
#contents .sidebar ul li {
font-size: 14px;
line-height: 24px;
margin: 0 0 24px;
}
#contents .sidebar ul span {
color: #636974;
display: block;
font-size: 12px;
line-height: 12px;
padding: 6px 0 5px;
}
#contents .sidebar ul li a {
color: #636974;
text-decoration: none;
}
#contents .sidebar ul li a:hover {
text-decoration: underline;
}
#sidebar, .highlight {
float: right;
display: inline-block;
border-left: 1px solid #f2cc3d;
margin: 0 0 24px 19px;
}
#sidebar .section {
border-top: 1px solid #f2cc3d;
padding-top: 24px;
}
#sidebar .section:first-child {
border: 0;
padding-top: 0;
}
#sidebar .section ul {
color: #636974;
font-size: x-small;
margin: 0 0 24px;
padding-left: 12px;
}
#sidebar .section ul li {
padding-left: 10px;
}
#sidebar .section ul li > a {
color: #636974;
display: block;
font-size: 14px;
line-height: 24px;
text-decoration: none;
}
#sidebar .section ul li a:hover {
text-decoration: underline;
}
/** list **/
ul.list {
list-style: none;
width: 600px;
margin: 0;
padding: 0;
}
ul.list li h5 + img {
float: left;
margin-right: 20px;
margin-top: 6px;
}
/** Main **/
#main > ul {
display: inline-block;
list-style: none;
width: 580px;
margin: 0;
padding: 0;
}
#main > ul li {
float: left;
width: 290px;
}
#main > ul li p b {
color: #2e3a54;
display: block;
font-family: 'DaysOne-Regular';
font-weight: normal;
text-transform: uppercase;
}
/** About **/
#contents #about {
padding-bottom: 0;
padding-top: 48px;
}
#about #main img {
margin-bottom: 18px;
}
#about .footer p {
font-size: 12px;
}
/** Services **/
#contents #services {
display: inline-block;
width: 900px;
}
#services #sidebar {
min-height: 620px;
}
/*------------------------------ FOOTER ------------------------------*/
#footer {
width: 100%;
border-top: 5px solid #c3c3c3;
position: absolute;
left: 0;
}
#footer .background {
border-top: 1px solid #b6051c;
}
#footer .body {
width: 960px;
margin: 0 auto;
padding: 40px 0 20px;
}
#footer .section {
float: left;
display: inline-block;
width: 460px;
margin: 0 10px 24px;
}
#footer h3 {
color: #fff;
font-family: 'DaysOne-Regular';
font-size: 18px;
font-weight: normal;
line-height: 18px;
margin: 0 0 18px;
text-transform: uppercase;
}
#footer ul {
list-style: none;
margin: 0;
padding: 0;
}
#footer ul li {
color: #b3999c;
display: inline-block;
font-size: 14px;
line-height: 24px;
width: 100%;
border-top: 1px solid #8a0413;
padding: 12px 0 0;
vertical-align:top;
}
#footer ul li:first-child, #footer #message ul li {
border: 0;
padding: 0;
}
#footer ul li span {
float: left;
display: inline-block;
width: 70px;
vertical-align:top;
}
#footer ul li strong {
float: left;
display: inline-block;
margin-right: 6px;
vertical-align: top;
}
#footer ul li p {
float: left;
display: inline-block;
width: 370px;
margin: 0;
padding: 0 0 12px;
}
#footer ul li a {
color: #b3999c;
display: inline-block;
height: 22px;
width: 30px;
margin: 0 10px;
text-decoration: none;
}
#footer ul li a.twitter {
background-position: -40px 0;
}
#footer ul li a.facebook {
background-position: -40px -32px;
}
#footer ul li a.googleplus {
background-position: -40px -64px;
}
#footer ul li a.twitter:hover {
background-position: 0 0;
}
#footer ul li a.facebook:hover {
background-position: 0 -32px;
}
#footer ul li a.googleplus:hover {
background-position: 0 -64px;
}
/** message **/
#message label {
float: left;
color: #b3999c;
display: inline-block;
font-size: 14px;
line-height: 30px;
width: 96px;
margin-right: 10px;
text-align: right;
}
#message input[type='text'] {
color: #636974;
display: inline-block;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
height: 35px;
line-height: 35px;
width: 342px;
border: 1px solid #d7d7d7;
margin: 0 0 11px;
padding: 0 4px;
}
#message textarea {
color: #636974;
display: inline-block;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
height: 95px;
line-height: 24px;
width: 342px;
border: 1px solid #d7d7d7;
margin: 0 0 4px;
padding: 0 4px;
overflow: auto;
resize: none;
}
#message input[type='submit'] {
background-position: 0 0;
color: #636974;
cursor: pointer;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
height: 25px;
line-height: 25px;
width: 52px;
border: 0;
margin-left: 106px;
padding: 0;
}
#message input[type='submit']:hover {
background-position: -62px 0;
color: #2e3a54;
}
#footnote {
clear: both;
color: #b75661;
font-size: 12px;
margin: 0;
text-align: center;
}
On my site, all the pages of text, stay within the wrapper which goes to the bottom of the page. For some reason on a page with images, the wrapper doesn't go to the bottom, nor does the div which holds the images.
Here is the html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Just Joel</title>
<link href="../CSS/JJ.css" rel="stylesheet" type="text/css" />
<link href="../CSS/grogrotesque.css" rel="stylesheet" type="text/css">
<link href="../CSS/stylesheet.css" rel="stylesheet" type="text/css">
<meta charset="utf-8" />
<script type="text/javascript" src="../js/jquery-1.4.3.js"></script>
<script type="text/javascript" src="../js/jquery.corner.js"></script>
<script type='text/javascript' src="../js/slideshow.js"></script>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<link href="../../../CSS/JJ.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapperfull">
<div id="header">
<img src="../../../Images/Header.png" width="379" height="99" alt="Just Joel Header">
</div><!-- end header div -->
<div class="navigation">
<div class="menu-holder">
<ul class="menu">
<li>Home
</li>
<li>About
</li>
<li>Work
<ul class="submenu">
<li>Print
</li>
<li>Branding
</li>
<li>Photography
</li>
</ul>
</li>
<li>Blog
</li>
<li>Inspired
</li>
<li>Contact
</li>
</ul>
</div>
<!-- menu-holder end -->
</div><!-- end navigation div -->
<div class="blog-container">
<div id="sidebarwrapper">
<div id="sidebar">
<h1>TREE TOP NEWS</h1>
<br>
<p>Tree Top News is a publcation produced through Highgate Woods, a heritage woodland in London</p>
<p>I produced the publication two years running, capturing the amazing nature and wildlife around he wood. I was responsible for rt direction, design and print.</p>
</div><!--sidebar!-->
</div>
<div class="project">
<img src="../../../Images/Tree Top News/P7158702.jpg" alt="Tree Top" class="image" height="378" width="580">
<img src="../../../Images/Tree Top News/P7158703.jpg" alt="Tree Top" class="image" height="378" width="580">
<img src="../../../Images/Tree Top News/P7158711.jpg" alt="Tree Top" class="image" height="378" width="580">
<img src="../../../Images/Tree Top News/P7158701.jpg" alt="Tree Top" class="image" height="378" width="580">
<img src="../../../Images/Tree Top News/Tree Top News 2010-6.jpg" alt="Tree Top" class="image" height="378" width="580">
</div>
</div>
</div>
</body>
</html>
Here is the CSS
#wrapperfull {
min-height: 100%;
width: 1050px;
border: none;
margin-top: 0px;
background-color: #FFF;
position: relative; /* for the absolute positioned footer */
margin-right: auto;
margin-bottom: auto;
padding-top: 0.1px;
padding-right: 30px;
padding-bottom: 0px;
padding-left: 30px;
}
#head {
height: 100px;
width: 1050px;
border: none;
margin: auto;
background-color: #FFF;
position: fixed;
}
#header {
height: 135px;
width: 1045px;
font-family: Helvetica, sans-serif;
position: fixed;
background-color: #FFF;
margin-top: 0px;
}
#footer {
position: absolute;
width: 1050px;
height: 85px;
bottom: 0;
padding: 0px;
margin-bottom: 150px;
}
.footer-style {
padding: 40px;
}
h1 {
font-family: "geogtq md";
color: #00BDE5;
font-size: 25px;
text-decoration: none;
margin-top: 35px;
}
h1:hover {
color: #007889;
font-size: 25px;
}
h2 {
font-family: Helvetica, sans-serif;
color: #00BDE5;
font-size: 25px;
text-decoration: none;
}
h2:hover {
color: #007889;
font-size: 25px;
}
p {
font-family: Helvetica, sans-serif;
color: #01778B;
font-size: 12px;
text-align: justify;
}
img {
float: right;
}
html {
margin: 0;
padding: 0;
border: none;
height: 100%;
}
body {
margin: 0;
padding: 0;
border: none;
height: 100%;
background-image: url(../Images/stripe_70d2cce6f1e8675c4b38e18625444054.png);
background-repeat: repeat;
}
/* because of the box model anong with the height and set width, you'll want to have padding, border, and margin set to 0. Auto left and right margins are ok for centering. */
.container {
height: 100%;
width: 1050px;
margin-top:120px;
display: inline-block;
background-color: #FFF;
}
.heading {
height: 90px;
width: 750px;
float: left;
margin-top: 70px;
position: fixed;
background-color: #FFF;
margin-bottom: 35px;
margin-left: auto;
}
.blog-container {
min-height: 100%;
width: 700px;
margin-top: 170px;
margin-right: 0px;
background-color: #FFF;
}
.work-container {
min-height: 100%;
width: 585px;
margin-top: 70px;
background-color: #FFF;
}
.slideshow {
width: 900px;
list-style: none;
position: relative;
margin-top: 25px;
}
ul.slideshow li {
position: absolute;
left: -2px;
top: -9px;
display: inline;
}
.navigation {
height: 150px;
width: 600px;
margin-top: 0px;
margin-left: auto;
padding-top: 20px;
font-family: Helvetica, sans-serif;
position: fixed;
background-color: #FFF;
}
.menu-holder ul {
height: 120px;
padding: 0;
list-style-type: none;
}
.menu-holder ul li {
position: relative;
float: left;
line-height: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 100px;
margin-left: 0px;
padding-top: 0px;
padding-right: 10px;
padding-bottom: 0;
padding-left: 0px;
}
.menu-holder ul li:hover ul {
display: block;
float: left;
color: #000;
}
.menu-holder ul li a {
font-family: Helvetica, sans-serif;
font-size: 15px;
display: block;
color: #00BDE5;
text-decoration: none;
padding-top: 15px;
padding-right: 10px;
padding-bottom: 15px;
padding-left: 0px;
}
.menu-holder ul li a:hover {
color: #007985;
}
.menu-holder ul li ul {
float: none;
display: none;
position: absolute;
top: 35px;
left: -10px;
margin: -1px 0 0px 10px;
padding: 5px 10px 5px 10px;
white-space: nowrap;
}
.menu-holder ul li ul:hover {
display: block;
}
.menu-holder ul li ul li {
position: static;
float: none;
display: inline;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px -10px;
margin-right: 20px;
}
.menu-holder ul li ul li a {
display: inline;
margin: 0 0px 0 0px;
-webkit-border-radius: 0;
}
a:link {
text-decoration: none;
color: #000;
font-family: Helvetica, sans-serif;
}
a:hover {
text-decoration: none;
color: #000;
font-family: Helvetica, sans-serif;
}
ul {
font-size: 15px;
margin: 0;
padding: 0;
list-style: none;
margin-right: 40px;
}
ul li, ul li ul li {
display: inline;
position: relative;
float: left;
color: #00BDE5;
}
li ul {
display: none;
width: 450px;
margin-right: 20px;
}
ul ul li a {
font-family: Helvetica, sans-serif;
font-size: 15px;
text-decoration: none;
margin-right: 15px;
white-space: nowrap;
color: #00BDE5;
margin-right: 20px;
}
li:hover ul {
display: inline;
position: absolute;
}
li:hover li {
float: none;
font-size: 15px;
margin-top:3px;
}
.services1 a {
font-family: Helvetica, sans-serif;
font-size: 12px;
color: #00BDE5;
float: left;
list-style-type: none;
}
a:link {
text-decoration: none;
color: #00BDE5;
font-family: Helvetica, sans-serif;
text-align: center;
}
a:hover {
text-decoration: none;
color: #007889;
font-family: Helvetica, sans-serif;
text-align: center;
}
/* Thumb size 230 x 150 px */
.work_thumbs {
width:1000px;
margin: 0px auto 0 auto;
float: left;
}
.work_thumbs li {
margin: 0px 15px 15px 0px;
list-style-type: none;
display: block;
float: left;
display: inline;
font-family: Helvetica, sans-serif;
color: #FFF;
overflow: hidden;
}
.work_thumbs li a {
float: inherit;
display: block;
width: 230px;
padding-bottom: 20px;
font-family: Helvetica, sans-serif;
color: #00BDE5;
height: 180px;
border: 1px solid #02BDE5;
overflow: hidden;
text-align: centre;
font-size: 12px;
}
.work_thumbs li .type {
color: #01BDE6;
}
.work_thumbs li a:hover {
background-color: #ceeef6;
border-bottom: 1px solid #02BDE5;
text-decoration: none;
color: #007789;
font-family: Helvetica, sans-serif;
text-align: centre;
}
.work_thumbs li .thumb {
margin-bottom: 15px;
display:block
}
.project {
width: 580px;
height: 1000px;
margin-top: 0px;
margin-right: 100px;
left: auto;
background-color: #fff;
}
.single .header {
position:static
}
.single #sidebar a {
color:#000;
}
.single #sidebar a:hover {
color:#4f4f4f
}
.image {
margin: 0px;
padding-bottom:50px;
}
/* Set fixed top margin */
#sidebar {
width: 273px;
height: 200px;
left: 50%;
top: 165px;
background-color: #FFF;
padding: 10px 20px 10px 10px;
color:#00C0EE;
font-family: Helvetica, sans-serif;
position: fixed;
color: #007789;
font-size: 15px;
}
#sidebar h1 {
font-family: Helvetica, sans-serif;
padding: 5px 0 15px 0;
font-weight: normal;
font-size: 18px;
color: #00C0EE;
}
#sidebar p {
padding-bottom: 15px;
font-family: Helvetica, sans-serif;
color: #007789;
height: 100%;
}
#sidebarwrapper {
right: 822px;
position: absolute;
width: 205px;
height: 200px;
top: 248px;
}
* {
margin: 0; padding: 0;
}
#page-wrap {
width: 600px;
margin: 15px auto;
position: relative;
}
#sidebar ul {
background: #EEE;
padding: 10px;
}
li {
float: left;
display: inline;
}
#main {
width: 700px;
float: left;
}
http://jsfiddle.net/Q6Lze/
You need a clearfix to clear the floats contained within. This forces the div containing the floated images take up that space instead of collapse into itself:
.project:after {
display: table;
content: '';
clear: both;
}
Or just add it to div:after instead