Having issues adjusting layout to fit the whole screen - css

I'm a beginner and would like to get some help and see where I'm making a mistake. I've adjusted my css to try to make the footer drop to the bottom of the page no matter the screen size that's view the page. I tried adjusting the body height to be at 100%, but that did not work.
I'm trying to make it so the bottom footer is just below the fold, so it can only be seen once you scroll down, and not seen we you first get to the page.
If there is any advice on how I can solve my issue, it would be much appreciated thanks.
Here are some pictures to give you an example & the CSS
Mobile
Tablet Vertical
Tablet Horizontal
CSS:
body {
margin: 0;
padding: 0;
background: #FFFFFF;
font-family: 'Open Sans Condensed', sans-serif;
font-size: 18px;
color: #000000;
width:100%;
height:100%;
}
h1, h2, h3 {
margin: 0;
padding: 0;
font-weight: normal;
color: #000000;
}
h1 {
font-size: 1.5em;
}
h2 {
font-size: 1em;
margin-top: 1.8em;
text-align:left;
}
h3 {
font-size: 1.6em;
}
p, ul, ol {
margin-top: 0;
line-height: 100%;
}
ul, ol {
}
a {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
#wrapper {
overflow: hidden;
background-color: #FFFFFF;
}
#bottom-wrapper {
overflow: hidden;
position:relative;
bottom:0;
height: 100px;
padding: 5px 0px 0px 0px;
background: url(images/blue-background.jpg) repeat-x left top;
}
#bottom {
overflow: hidden;
width: 960px;
height: 200px;
margin: 0 auto;
padding: 0px 20px;
}
.abouttext {
width: 625px;
margin: 10px auto;
}
.three {
width: 1000px;
margin: 10px auto;
padding: 10px 140px;
}
.container {
width: 880px;
margin: 10px auto;
}
#container {
display: table;
}
#row {
display: table-row;
}
#left, #right, #middle {
display: table-cell;
}
/* Header */
#header-wrapper {
overflow: hidden;
height: 110px;
background: url(images/blue-background.jpg) repeat-x left top;
}
#header {
overflow: hidden;
width: 100%;
height: 200px;
margin: 0 auto;
padding: 0px 20px;
font-weight: bold;
}
/* Banner */
#banner {
overflow: hidden;
height: 100px;
background: url(images/img04.jpg) no-repeat center bottom;
}
#banner .image-style {
border: 15px solid #F4F4F4;
}
/* Logo */
#logo {
float: left;
width: 400px;
margin: 0;
padding: 0;
color: #000000;
}
#logo h1, #logo p {
}
#logo h1 {
padding: 10px 0px 0px 0px;
font-size: 3.0em;
}
#logo p {
margin-top: -10px;
padding: 0px 0px 0px 5px;
font-size: 20px;
color: #FFFFFF;
}
#logo p a {
color: #FFFFFF;
}
#logo a {
border: none;
background: none;
text-decoration: none;
color: #FFFFFF;
}
/* Splash */
#splash {
overflow: hidden;
padding: 0px 0px 0px 0px;
border-bottom: 1px dashed #E7E2DC;
letter-spacing: 0px;
text-align: center;
vertical-align:middle;
font-size: 18px;
}
div.home-rt, div.cat{
/*width:310;height:355;*/
text-align:center;/*border:solid 2px #e0e0e0;*/
margin: 0 auto;
vertical-align:top;
display:inline-block;
cursor:pointer;
}
.iPad_1, .iPad_2, .iPad_3, .iPad_4, .iPad_Air, .iPad_Mini, .iPad_MiniRetina
{
margin:10px 10px 10px 10px;
}
.iPhone_2G, .iPhone_3G, .iPhone_3GS, .iPhone_4, .iPhone_4S, .iPhone_5, .iPhone_5C, .iPhone_5S
{
margin:10px 10px 10px 10px;
}
#splash div.home-rt {
/*margin-top:10px;
margin-bottom:10px;*/
width:310;
height:355;
background:#fff;
}
#splash .home-rt {
text-align:center !important;
}
#splash span {
color: #313131;
}
/* Search */
#search {
float: right;
width: 280px;
height: 60px;
padding: 20px 0px 0px 0px;
}
#search form {
height: 41px;
margin: 0;
padding: 10px 0 0 20px;
}
#search fieldset {
margin: 0;
padding: 0;
border: none;
}
#search-text {
width: 170px;
padding: 6px 5px 2px 5px;
border: 1px solid #DEDEDE;
background: #FFFFFF;
font: normal 11px Arial, Helvetica, sans-serif;
color: #5D781D;
}
#search-submit {
width: 50px;
height: 22px;
border: none;
background: #B9B9B9;
color: #000000;
}
/* Menu */
#menu {
float: right;
width: 500px;
height: 90px;
margin: 0 auto;
padding: 0;
}
#menu ul {
float: center;
margin: 0;
padding: 15px 0px 0px 0px;
list-style: none;
line-height: normal;
}
#menu li {
float: left;
}
#menu a {
display: block;
margin-right: 1px;
padding: 10px 0px 15px 30px;
text-decoration: none;
text-align: center;
font-size: 20px;
font-weight: 300;
color: #FFFFFF;
border: none;
}
#menu a:hover, #menu .current_page_item a {
text-decoration: none;
color: #000000;
}
#menu .current_page_item a {
}
/* Page */
#page {
padding: 30px 0px 0px 0px;
}
/* Content */
#content {
float: left;
width: 620px;
padding: 0px 40px 0px 0px;
background: url(images/img05.jpg) no-repeat right 40px;
}
.post {
overflow: hidden;
}
.post .title {
padding: 0px 0px 10px 0px;
letter-spacing: -3px;
}
.post .title a {
border: none;
color: #7D7764;
}
.post .meta {
margin-bottom: 30px;
padding: 0px;
text-align: left;
font-size: 16px;
}
.post .meta .date {
float: left;
}
.post .meta .posted {
float: right;
}
.post .meta a {
}
.post .entry {
padding: 0px 0px 10px 0px;
padding-bottom: 20px;
text-align: justify;
}
.links {
padding-top: 20px;
margin-bottom: 30px;
}
.more {
display: block;
float: left;
width: 88px;
height: 25px;
padding: 2px 0px 0px 0px;
margin-right: 10px;
background: url(images/img08.jpg) no-repeat left top;
text-align: center;
color: #FFFFFF;
}
.comments {
display: block;
float: left;
width: 88px;
height: 25px;
padding: 2px 0px 0px 0px;
background: url(images/img08.jpg) no-repeat left top;
text-align: center;
color: #FFFFFF;
}
/* Sidebar */
#sidebar {
float: right;
width: 320px;
margin: 0px;
padding: 0px 0px 0px 0px;
color: #000000;
}
#sidebar h2 {
padding: 0px 0px 30px 0px;
letter-spacing: -3px;
}
#sidebar a {
border: none;
}
#sidebar a:hover {
text-decoration: underline;
}
/* Calendar */
#calendar {
}
#calendar_wrap {
padding: 20px;
}
#calendar table {
width: 100%;
}
#calendar tbody td {
text-align: center;
}
#calendar #next {
text-align: right;
}
/* Three Column Footer Content */
#footer-content {
background: url(images/img04.png) no-repeat center top;
color: #E2B8C6;
}
#footer-bg {
overflow: hidden;
padding: 170px 0px;
}
#footer-content h2 {
margin: 0px;
padding: 0px 0px 20px 0px;
letter-spacing: -2px;
text-shadow: 1px 2px 0px #861F40;
font-size: 16px;
color: #FFFFFF;
}
#column1 {
float: left;
width: 320px;
margin-right: 20px;
}
#column2 {
float: left;
width: 320px;
}
#column3 {
float: right;
width: 320px;
}
/* Footer */
#footer {
height: 100px;
margin: 0 auto;
padding: 10px 0px 0px 0px;
/*background: url(images/img04.png) no-repeat center top;*/
}
#footer p {
margin: 0;
padding-top: 150px;
line-height: normal;
text-align: center;
color: #000000;
}
#footer a {
color: #000000;
}
#marketing {
overflow: hidden;
margin-bottom: 30px;
padding: 20px 0px 10px 0px;
border-top: 1px solid #E3E3E3;
border-bottom: 1px solid #E3E3E3;
}
#marketing .text1 {
float: left;
margin: 0px;
padding: 0px;
letter-spacing: -2px;
font-size: 14px;
color: #000000;
}
#marketing .text2 {
float: right;
}
#marketing .text2 a {
display: block;
width: 252px;
height: 38px;
padding: 15px 0px 0px 0px;
background: url(images/img07.jpg) no-repeat left top;
letter-spacing: -2px;
text-align: center;
font-size: 12px;
color: #000000;
}
.box1 {
overflow: hidden;
height: 100px;
background: url(images/img04.jpg) no-repeat center bottom;
}
.list-style1 {
margin: 0px;
padding: 0px;
list-style: none;
}
.list-style1 li {
padding: 7px 0px 7px 0px;
border-top: 1px dashed #E7E2DC;
}
.list-style1 .first {
padding-top: 0px;
border-top: none;
}
.list-style2 {
margin: 0px;
padding: 0px;
list-style: none;
}
.list-style2 li {
padding: 7px 0px 7px 0px;
background: url(images/img06.png) repeat-x left top;
}
.list-style2 a {
color: #E2B8C6;
}
.list-style2 a:hover {
color: #C76485;
}
.list-style2 .first {
padding-top: 0px;
background: none;
}

You mentioned:
I'm trying to make it so the bottom footer is just below the fold, so it can only be seen once you scroll down, and not seen we you first get to the page.
I don't think css alone is capable of doing this, I got a quick jsfiddle for you that may help.
windowHeight = $(window).height();
footerHeight = $(".footer").height();
$(".wrap").css({
"height": windowHeight + footerHeight
});

Related

Having trouble once I added iframe

This is sort of the same issue I asked here: Cannot get two CSS elements to be next to each other
However, this time, it's messing up when I added an iframe. I tried applying different styles, even to the iframe, but it doesn't appear to be working. I also messed with the CSS of the ul and li that I added to the side nav bar (didn't help, though changing the ul property to display: table-row; did fix another issue I had with something else.)
My main plan was to have an iframe to another group of pages. (My restaurant pages might have more than one tab for each restaurant, but I had been wondering how to have a "back" thing to my ski resort (where the restaurants are) so the user could go back to them. I then thought, why not just have an iframe instead?
However, once I added the iframe, the trouble I had before (see previous stack overflow link above) suddenly came back.
main.css:
#logo
{
border: 1px dashed purple;
width: 1050;
height: 75;
}
#logo > img
{
width: 1050;
height: 75;
}
.floatleft
{
float: left;
}
.floatright
{
float: right;
}
#content
{
border-left: 3px solid #283379;
border-right: 3px solid #283379;
text-align: left;
margin: 0 auto;
width: 960px;
background-color: #ffffff;
background-repeat: repeat-y;
height: 800;
}
nav
{
border: 10px solid transparent;
padding: 15px;
border-image-source: url(./blue-diamond.gif);
border-image-repeat:repeat;
border-image-slice: 30;
background-color: 2211ff;
font-family: "Impact", Times, serif;
font-size: 110%;
}
nav#vert
{
width: 220px;
height: 540px;
margin: 0px;
display:table-cell;
}
body {
color: #000000;
margin: 0;
padding: 0;
font-family: Helvetica, Arial, sans-serif;
font-size: 16px;
background-color: #422520;
background-image: url(./snow_mountain.jpg);
background-repeat:no-repeat;
background-size:cover;
text-align: center;
background-attachment: fixed;
background-position: center;
}
#footerContainer
{
border-left: 3px solid #283379;
border-right: 3px solid #283379;
text-align: left;
margin: 0 auto;
width: 980px;
background-color: #ffffff;
background-repeat: repeat-y;
}
footer
{
border: 10px solid transparent;
padding: 15px;
text-align: left;
margin: 0 auto;
width: 1000px;
background-repeat: repeat-y;
border-image-source: url(./blue-diamond.gif);
border-image-repeat:repeat;
border-image-slice: 30;
background-color: 2211ff;
font-family: "Impact", Times, serif;
font-size: 14px;
color: white;
}
footer > a
{
color: white;
font-family: "Impact", Times, serif;
font-size: 14px;
}
#container
{
border-left: 3px solid #283379;
border-right: 3px solid #283379;
text-align: left;
margin: 0 auto;
width: 1050px;
background-color: #ffffff;
background-repeat: repeat-y;
height: 750px;
}
nav > a
{
color: #ccccff;
}
nav#hor > div
{
border: 1px solid white;
float: left;
padding: 10px;
background-color: #000044;
}
nav#hor
{
width: 1000px;
height: 50px;
margin: 0;
font-size: 110%;
}
nav#hor a
{
color: rgb(0 0,238);
}
nav#hor > div > a
{
color: #ccccff;
text-decoration: none;
font-size: 100%;
}
nav#hor>div:hover
{
background-color: #018802;
}
h1
{
font-family: "MV Boli", Times, Serif;
font-style: bold;
text-align: center;
font-size: 36px;
}
h2
{
font-family: "MV Boli", Times, Serif;
font-style: bold;
text-align: center;
font-size: 26px;
}
h3
{
font-family: "MV Boli", Times, Serif;
font-style: bold;
text-align: center;
font-size: 20px;
}
#text-container
{
border: 2px solid cyan;
width: 1005px;
height: 690px;
*/ zoom: 1;
*/ margin: 0;
display: table-cell;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
}
#text-container:after
{
clear: both;
content: ".";
display: block;
height: 0;
visibility:hidden;
}
#text-container > p
{
font-family: "Myriad Web Pro", Times, Serif;
font-size: 18px;
}
.left img
{
float: left;
padding: 0 20px 20px 0;
}
.left > p
{
font-family: "Myriad Web Pro", Times, Serif;
font-size: 18px;
}
.right img
{
float: right;
margin: 0px 0px 15px 20px;
border: 1px solid transparent;
}
.right > p
{
font-family: "Myriad Web Pro", Times, Serif;
font-size: 18px;
}
nav#hor ul
{
list-style-type: none;
margin: 0;
padding: 0;
overflow: auto;
background-color: #000044;
}
nav#hor ul li:hover
{
background-color: #018802;
}
nav#vert ul
{
list-style-type: none;
margin: 0;
padding: 0;
overflow: auto;
background-color: #000044;
display: table-row;
}
nav#hor li
{
float: left;
border: 1px solid white;.
}
nav#vert li
{
float: left;
border: 1px solid white;.
}
nav#vert li a, .dropbtn {
display: inline-block;
// color: white;
text-align: center;
padding: 8px 8px;
text-decoration: none;
}
nav#hor li a, .dropbtn {
display: inline-block;
// color: white;
text-align: center;
padding: 8px 8px;
text-decoration: none;
}
nav#hor li a:hover, .dropdown:hover .dropbtn {
background-color: #018802;
}
nav#vert li a:hover, .dropdown:hover .dropbtn {
background-color: #018802;
}
li.dropdown {
display: inline-block;
}
.dropdown-content ul li
{
width: 100%;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
color: rgb(0, 0, 238);
z-index: 1;
}
#eAndADropdown
{
}
#restaurantDropdown li
{
background-color: #000044;
border: 1px solid white;
}
#restaurantDropdown ul
{
border: 1px solid white;
}
#restaurantDropdown:hover
{
background-color: #018802;
}
#restaurantDropdown a
{
color: rgb(0, 0, 238);
}
.dropdown-content a {
color: rgb(0, 0, 238);
border: 1 px solid white;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.show {display:block;}
li a
{
color: rgb(0, 0, 238);
}
testingMongoose.php
<html>
<head>
<title> The Mountains </title>
<link rel="stylesheet" type="text/css" href="./main.css">
<link rel="icon" href="./ski_icon.png">
<script src="jquery-3.0.0.min.js" type="text/javascript"></script>
<script>
$( document ).ready(function() {
$("#container").css("height", 800);
});
</script>
</head>
<body>
<?php include 'topandside.php';?>
<div id="text-container">
<iframe src="./index.php" width=700; height=620;></iframe>
</div>
</div>
</div>
<?php include 'footer.php';?>
</div>
</body>
</html>
This time, having display: table-cell; for both nav#vert and #text-content doesn't appear to be enough like it was before.
float: left on the nav#vert seems to have fixed that issue, though it broke some other things (though I should be able to fix those.)

Content Jumps When Loading Page

Whenever I load my page, the content area for the product jumps to position (shifts downwards) and so do the social media icons in the footer. You'll see this happen if you refresh the page or simply click on either of the product categories on the left or the navigation links in the fixed footer.
This is happening predominately in Safari. I'm running 8.0.7 on Mac OS X 10.10.4 (Yosemite). Firefox 45.0.2 seems ok. Chrome 50.0.2661.86 acts a little weird with the icons flashing and copyright text, so I believe that has the same issue though the load time may be quicker.
I've looked at my CSS, but I can't fathom why it's doing it(?). I'm really stuck and realise it's perhaps something simple I'm overlooking. Driving me loopy! :-(
A friend told me it has something to do with the floats for the catalogue_wrapper_right, it shouldn't be there. That's for the content. And, I'm not sure again for the footer. Help much appreciated to get this fixed.
The product content text is being populated using PHP from my database.
The key elements here to look at are catalogue_wrapper and catalogue_wrapper_right for the content, and then container and social for the footer div blocks.
Thanks.
CSS:
/* ===============================
Author: Ashley Smith
Date: July 11, 2015
Notes:
Colour Palette:
---------------
Light Cream: #f2f3ee
Orange: #d17f38
Yellow: #e8c04f
Brown: #4b2707
=============================== */
/* General */
body {
background: url('../images/wood 4.jpg') top left no-repeat; top no-repeat; background-attachment: fixed;
background-size: 100% 100%;
color: black;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
font-size: 14px;
font-family: 'Open Sans', "Helvetica Neue", Arial, sans-serif;
}
.container {
width: 1280px;
margin: 0 auto;
padding: 30px 24px;
background: white;
-webkit-box-shadow: 0px 0px 19px 0px rgba(0,0,0,1);
-moz-box-shadow: 0px 0px 19px 0px rgba(0,0,0,1);
box-shadow: 0px 0px 19px 0px rgba(0,0,0,1);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
clear: both;
}
/* Typography */
p {
margin: 0;
padding: 0;
}
a {
text-transform: uppercase;
text-decoration: none;
list-style: none;
padding: 0px 10px;
font-weight: bold;
color: black;
margin: 0;
}
/* Header */
header.main{
background: white;
padding: 10px;
margin-top: -30px;
margin-bottom: -30px;
height: 141px;
}
header nav {
text-align: center;
}
header nav ul {
margin: 0;
padding: 0;
list-style: none;
display: inline-block;
line-height: 141px;
}
header nav ul li {
display: inline-block;
padding: 0 20px;
}
header nav ul li a {
text-transform: uppercase;
text-decoration: none;
font-weight: bold;
}
header nav ul li#logo a {
display: block;
width: 200px;
height: 150px;
padding: 0;
background: url('../images/LogoM.svg') center center no-repeat;
background-size: 300px;
}
header nav ul li#logo a p {
opacity: 0;
}
/* Small Basket */
#small_basket {
width: 200px;
margin-bottom: 20px;
}
#basket_left dt {
clear: left;
width: 170px;
}
#basket_left {
margin-top: 30px;
margin-bottom: 0;
}
#basket_left dd {
text-align: right;
width: 150px;
margin-bottom: 15px;
}
#basket_left, #basket_left dd, #basket_left dt {
float: left;
}
#basket_left dd.bl_ti, #basket_left dd.bl_st, #basket_left dd.bl_vat, #basket_left dd.bl_total {
display: block;
width: 0px;
padding: 0;
clear: all;
margin-left: 0px;
}
.your_bas {
width: 200px;
border-bottom: dashed 1px #aaa;
padding-bottom: 9px;
}
.check_button {
border-bottom: dashed 1px #aaa;
}
.check_button, .check_button a {
clear: left;
padding: 0px 0px 14px 0px;
font-style: normal;
font-size: 14px;
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
font-weight: normal;
text-transform: none;
}
.red {
color: red;
}
span.cart_pic {
background: url('../images/cart.png') center center no-repeat;
display: inline-block;
position: relative;
top: 10px;
left: 15px;
width: 30px;
height: 30px;
}
/* Store Content Styling */
#wrapper {
width: 1280px;
text-align:left;
margin:0 auto;
padding: 14px 0;
}
#outer {
width: 1280px;
margin: 0 auto;
padding: 30px 24px;
background: white;
-webkit-box-shadow: 0px 0px 19px 0px rgba(0,0,0,1);
-moz-box-shadow: 0px 0px 19px 0px rgba(0,0,0,1);
box-shadow: 0px 0px 19px 0px rgba(0,0,0,1);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
#cat_left {
width: 150px;
}
#cat_left p {
font-size: 20px;
margin: -5px;
font-weight: 300;
text-indent: 5px;
}
#cat_right {
margin-left: 147px;
width: 900px
}
#cat_navigation {
margin-top: 20px;
margin-bottom: 14px;
width: 200px;
line-height: 35px;
list-style: none;
border-top: dashed 1px #aaa;
padding: 0;
float: left;
}
#cat_navigation li {
float: left;
background-color: rgba(209,209,209,0.4);
text-align: center;
width: 100%;
padding: 2px;
margin-bottom: 10px;
}
#cat_navigation li a {
width: 150px;
opacity: 0.2;
font-size: 14px;
font-weight: 300;
padding: 0;
}
#cat_navigation li a.act {
opacity: 1;
font-weight: 700;
}
#cat_prod {
border-bottom: dashed 1px #aaa;
margin-bottom: 0;
padding-bottom: 14px;
}
#cat_prod h1 {
font-size: 20px;
margin: -5px;
margin-bottom: 1px;
font-weight: 300;
}
/* Catalogue Styling For Products Alignment... Continued */
.catalogue_wrapper {
width:100%;
border-bottom: dashed 1px #aaa;
height: 100%;
display: block;
clear: both;
position: static;
}
.catalogue_wrapper_left {
display: inline-block;
width: 120px;
margin-top: 20px;
}
.catalogue_wrapper_right {
display: block;
width: 750px;
position: relative;
left: 150px;
height: 180px;
margin-top: -120px;
margin-bottom: -40px;
}
.catalogue_wrapper_right h4 a {
padding: 0;
font-size: 20px;
}
.catalogue_wrapper_left a img {
width: 120px;
height: 150px;
}
.catalogue_wrapper_left a {
padding: 0;
}
/* Catalaogue Floats */
#cat_left, #cat_right, #catalogue_wrapper, #catalogue_wrapper_left, #catalogue_wrapper_right {
float: left;
}
/* Catalogue Products Pages */
.catalogue_wrapper_product_right {
font-size: 20px;
font-weight: bold;
text-transform: uppercase;
display: block;
width: 750px;
position: relative;
left: 150px;
height: 180px;
margin-top: -70px;
margin-bottom: -40px;
}
.product_info {
font-size: 14px;
display: block;
width: 750px;
text-transform: none;
top: -63px;
}
/* Buttons */
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/* Basket and Checkout Buttons */
.sbm, .btn {
vertical-align: middle;
cursor: pointer;
display:block;
text-transform: uppercase;
font-weight: bold;
font-size: 14px;
}
.sbm_blue {
background: transparent;
background-color: #43a9d9;
border-radius: 4px;
border: none;
padding: 10px 15px;
}
.btn {
text-transform: uppercase;
background: transparent;
background-color: #43a9d9;
border: none;
border-radius: 4px;
color: white;
}
#btn_login {
text-transform: uppercase;
border-radius: 4px;
background: transparent;
background-color: #43a9d9;
border: none;
color: white;
padding: 0px 15px;
}
#btn {
text-transform: uppercase;
background-color: #43a9d9;
border-radius: 4px;
color: white;
padding: 0px 15px;
}
.fl_l {
float: left;
}
.fl_r {
float: right;
}
/* Basket Button */
.add_to_basket {
padding: 6px 12px;
text-transform: uppercase;
background-color: #43a9d9;
border-radius: 4px;
color: white;
}
/* Basket Page */
.ta_r, th.ta_r, .td.ta_r {
text-align: right;
padding: 10px;
}
.ta_left {
text-align: left;
padding: 10px;
}
.ta_right {
text-align: right;
padding: 10px 0px;
}
.col_15 {
width: 15%
}
.tbl_repeat {
width: 900px;
margin-top: 25px;
}
.ta_left_name {
text-align: left;
padding: 10px;
width: 650px;
}
.ta_left_qty input {
width: 40px;
}
.ta_r a {
padding: 0;
text-transform: none;
}
.fld_qty {
border: solid 1px #aaa
}
.fld_qty {
width: 30px;
text-align: right;
padding: 0
}
/* Checkout Page */
.tbl_insert {
margin-bottom:14px;
width: 900px;
line-height: 34.5px;
}
.tbl_insert td {
padding:3px;
}
.tbl_insert th {
padding: 3px 10px 3px 0;
width: 170px;
font-weight: normal;
vertical-align: top;
}
.fld {
width: 700px;
}
.warn {
display: block;
color: #900;
padding: 0;
vertical-align: text-bottom;
}
/* Orders Table */
.order_table {
width: 900px;
}
th.fix_width {
width: 900px;
}
hr#prod_break {
/* Gradient transparent - color - transparent */
border: 0;
height: 1px;
width: 600px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.tbl_repeat
{
position:relative;
-webkit-box-shadow:0 1px 10px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 1px 10px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.1) inset;
box-shadow:0 1px 10px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.tbl_repeat:before, .tbl_repeat:after
{
position:absolute;
z-index:-1;
-webkit-box-shadow:0 0 20px rgba(0,0,0,0.8);
-moz-box-shadow:0 0 20px rgba(0,0,0,0.8);
box-shadow:0 0 20px rgba(0,0,0,0.8);
top:50%;
bottom:0;
left:10px;
right:10px;
-moz-border-radius:400px / 100px;
border-radius:400px / 100px;
}
/* Product Paging */
.paging {
list-style: none;
width: 900px;
float: left;
/* background: #efefef; */
padding: 10px 10px;
color: white;
}
.paging li {
float: left;
margin-right: 10px;
font-size: 14px;
}
.paging a {
text-transform: none;
text-decoration: underline;
color: black;
padding: 0;
font-weight: normal;
color: white;
}
/* Pagination Navigation Buttons
http://www.flaticon.com/packs/metrize - - no class colour: #D9D9D9
*/
a.first {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/first.svg') top center no-repeat;
background-size: 32px;
}
a.firstno {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/firstno.svg') top center no-repeat;
background-size: 32px;
}
a.previous {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/previous.svg') top center no-repeat;
background-size: 32px;
}
a.previousno {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/previousno.svg') top center no-repeat;
background-size: 32px;
}
a.next {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/next.svg') top center no-repeat;
background-size: 32px;
}
a.nextno {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/nextno.svg') top center no-repeat;
background-size: 32px;
}
a.last {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/last.svg') top center no-repeat;
background-size: 32px;
}
a.lastno {
position: relative;
display: block;
width: 32px;
height: 32px;
background: url('../images/lastno.svg') top center no-repeat;
background-size: 32px;
}
a#top_of_page {
display: block;
position: relative;
text-transform: uppercase;
text-decoration: none;
font-weight: bold;
background-color: #43a9d9;
top: -31px;
left: 45px;
color: white;
border-radius: 4px;
padding: 7px;
}
/* Proceed to Paypal */
#frm_pp {
display: none
}
.dn {
display: none;
}
/* Google reCAPTCHA */
.g-recaptcha {
display: inline-block;
position: relative;
width: 304px;
height: 78px;
}
/* Footer */
footer.main, #footer {
bottom: 0px;
width: 100%;
height: 182px;
position: fixed;
text-align: center;
margin-bottom: -20px;
}
footer.main div.footbord {
border-top-left-radius: -10px;
border-top-right-radius: -10px;
background-color: blue;
}
#uncopyright, #credits {
width: 100%;
margin: 5px 5px;
text-align: center;
display: inline-block;
position: static;
clear: both;
}
#uncopyright {
display: inline-block;
position: static;
margin-top: -20px;
clear: both;
}
div.social img {
width: 40px;
position: relative;
margin: 5px;
display: inline-block;
}
.social {
position: static;
height: 56px;
display: inline-block;
}
.social, .social a {
text-transform: uppercase;
text-decoration: none;
list-style: none;
padding: 0px 10px;
font-weight: bold;
color: black;
margin: 0;
}
/* -- Center Placeholder For Form Text and Keep Entry Field Left -- */
::-webkit-input {
text-align: left;
}
::-webkit-input-placeholder {
text-align: center;
}
::-moz-placeholder {
text-align: center;
}
/* -- Blank Spacing At Bottom Of Main Container -- */
div.nav_top {
height: 30px;
width: 100px;
}
div.nav_top_after {
height: 30px;
width: 100px;
}
div.cont_bot {
height: 230px;
width: 100px;
}
div.cat_space {
height: 20px;
}
/* Force Elements To Self Clear Its Children: http://css-tricks.com/snippets/css/clear-fix/ */
.clearfix:after {
visibility: hidden;
display: block;
content: "";
clear: both;
height: 0;
}
* html .group { zoom: 1; } /* IE6 */
*:first-child+html .group { zoom: 1; } /* IE7 */
I fixed it by messing around all evening with floats in CSSEdit. A great application!

h1 tag positioning on mobile browser

I cant seem to figure out why the h1 tag is showing differently on mobile browsers.
The site is www.jd-financialservices.co.uk When I view the site on my desktop everything is fine. When I view it on my Nexus 4 however, the 10px gap between h1 and the .topbar div has gone. It's the same on Opera, Firefox and Chrome.
Can anyone help please?
Thank you in advance.
I would advise against using position:relative; and negative top on all of your elements.
With some minor changes to your css you will probably find that it fixes itself: here is my updated version of your css. See if that fixes things.
I updated: aside nav h1 .welcome and footer. By changing some of the header elements to use position:absolute and then using margin to space elements out. You will probably find the css is more compatible cross-browser/device.
#font-face { font-family: 'Constantia'; src: url('constantia/constantia.eot'); src: url('constantia/constantia.eot?#iefix') format('embedded-opentype'), url('constantia/constantia.svg#Constantia') format('svg'), url('constantia/constantia.woff') format('woff'), url('constantia/constantia.ttf') format('truetype'); font-weight: normal; font-style: normal;}
* {
margin-top: 0px;
margin-bottom: 0px;
}
html {
font-family: 'droid sans';
-webkit-font-smoothing: antialiased;
text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
}
body {
width: 940px;
margin: 0 auto;
}
li {
list-style: none;
}
a {
text-decoration: none;
color: #ffffff;
}
a:hover {
text-decoration: underline;
}
header a:hover {
text-decoration: none;
}
h1 {
font-family: 'Constantia', helvetica;
position: absolute;
top: 20px;
}
header {
height: 140px;
position: relative;
margin-bottom: 40px;
}
nav {
width: 660px;
height: 30px;
background-color: #00788a;
position: absolute;
font-size: 1.2em;
bottom: 0;
right: 0;
}
nav li a {
color: #ffffff;
}
nav a:hover {
text-decoration: underline;
}
nav ul {
padding-left: 0px;
}
nav ul li {
display: inline;
line-height: 30px;
vertical-align: middle;
color: #ffffff;
padding-left: 70px;
padding-right: 65px;
}
aside {
height: 600px;
width: 240px;
float: left;
background-color: #00788a;
color: #ffffff;
clear: both;
position: relative;
text-align: center;
margin-bottom: 30px;
}
article a {
color: #00788a;
}
.contain {
width: 940px;
}
footer {
height: 100px;
clear: both;
background-color: #00788a;
color: rgba(255,255,255,0.5);
position: relative;
font-size: 0.85em;
padding: 0 10px;
line-height: 1.5em;
margin-top: 40px;
}
footer li {
display: inline;
border-left: 2px solid rgba(255,255,255,0.5);
padding: 0 5px;
}
footer li:first-child {
border: none;
}
footer ul {
padding-left: 0;
text-align: center;
}
.foot_fade {
color: rgba(255,255,255,0.5);
}
.first_initial {
font-size: 110px;
color: #00788a;
font-weight: lighter;
}
.second_initial {
font-size: 101px;
color: #00788a;
font-weight: lighter;
position: relative;
top: -6px;
}
.rest_of_title {
font-size: 26px;
position: relative;
left: -73px;
top: 20px;
font-weight: lighter;
}
header a {
color: #000000;
}
.header_background {
float: right;
position: relative;
z-index: -1;
}
.topbar {
width: 940px;
height: 30px;
background-color: #00788a;
}
.call_now {
padding: 10px 50px 10px 50px;
font-size: 1.5em;
line-height: 1.5em;
border-bottom: 5px solid #ffffff;
text-shadow: 2px 2px 2px #2a2a2a;
}
.home_service {
padding: 10px 40px 10px 40px;
font-size: 1.45em;
line-height: 1.5em;
border-bottom: 5px solid #ffffff;
text-shadow: 2px 2px 2px #2a2a2a;
}
.service_list {
font-size: 1.25em;
line-height: 3em;
text-align: left;
padding-top: 35px;
padding-left: 20px;
text-shadow: 2px 2px 2px #2a2a2a;
}
.welcome {
width: 660px;
float: right;
padding: 0px 0px 0px 40px;
font-size: 0.9em;
line-height: 2em;
color: #2a2a2a;
position: relative;
/* top: -95px; */
text-align: justify;
}
.services {
width: 660px;
float: right;
padding: 0px 0px 0px 40px;
position: relative;
top: -95px;
}
.services a {
text-decoration: none;
position: absolute;
top: 151px;
left: 0;
width: 275px;
color: #ffffff;
background-color: rgba(0,0,0,0.5);
padding: 10px 0 10px 10px;
}
.services div {
margin-bottom: 15px;
}
.services div:last-child {
margin-bottom: 0;
}
.savings_pic {
position: relative;
height: 190px;
width: 285px;
}
.retire_pic {
position: absolute;
top: 0;
right: 0;
height: 190px;
width: 285px;
}
.protection_pic {
position: relative;
height: 190px;
width: 285px;
}
.insurance_pic {
position: absolute;
top: 205px;
right: 0;
height: 190px;
width: 285px;
}
.mortgage_pic {
position: relative;
height: 190px;
width: 285px;
}
.retire {
width: 300px;
float: right;
margin: 0 0 10px 10px;
}
/*.shadow {
box-shadow: 0 0 3px 1px rgba(42,42,42,0.5);
margin: 3px 0;
}*/
.overlay {
background-color: rgba(0, 0, 0, 0.5);
bottom: 54px;
color: #FFFFFF;
padding: 10px;
position: relative;
width: 265px;
}
.overlay a {
text-decoration: none;
color: #ffffff;
}
.overlay a:hover {
}
.left {
float: left;
}
.right {
float: right;
}
.regulation {
font-style: italic;
color: #9a9a9a;
font-size: 0.9em;
}
.smallprint {
width: 520px;
font-size: 0.9em;
text-align: center;
position: absolute;
right: 210px;
top: 30px;
}
.copyright {
width: 310px;
margin: 0 auto;
}
.scapa {
position: absolute;
bottom: 0;
right: 10px;
font-size: 0.9em;
}

CSS Navigation Bar Center

<head>
<title>WCK&TMB</title>
<style>
* {
margin: 0px;
padding: 0px;
}
html, body {
width: 100%;
background-color: #FFC18F;
}
div#container {
width: 100%;
min-width: 1024px;
}
header {
height: 100px;
width: 100%;
background-color: #ff8400;
text-align: center;
}
header img {
clear: left;
float: left;
margin: 10px;
}
header a#purchase {
background: url("http://i.imgur.com/RJe8a1D.png") repeat-x;
width: 500px;
height: 25px;
margin: 30px;
padding: 5px;
border: 3px double #ccc;
text-align: center;
float: right;
font-family: Arial;
font-size: 20px;
text-decoration: none;
color: #ffffff;
}
section#main {
padding: 0px 0px 10px 0px;
text-align: center;
}
section#main div#head_announcements {
padding-top: 10px;
color: #000;
font-family: "Arial";
}
section#main div#head_announcements h2 {
font-size: 24px;
font-weight: lighter;
line-height: 26px;
}
section#main h2 a {
color: #FFFFFF;
text-decoration: none;
}
section#main h2 a:hover {
color: #000000;
}
section#main nav {
background: url("./images/navBG.png") repeat-x;
width: 100%;
height: 35px;
text-align: center;
}
section#main nav a.link {
font-family: "Century Gothic";
text-decoration: none;
color: white;
font-size: 25px;
vertical-align: top;
float:center;
}
section#main nav a.link:nth-of-type(1) {
float:center;
}
section#main nav a.link:hover {
color: #39F;
}
section#main nav a.link.active {
color: #39F;
}
section#main section#frames {
margin-top: 10px;
width: 100%;
}
section#main section#frames iframe {
border: 0px;
outline: 0px;
overflow: hidden;
margin: 0px;
padding: 0px;
}
section#main section#frames iframe#frame1 {
width: 650px;
height: 450px;
background-color: black;
}
section#main section#frames iframe#frame2 {
width: 350px;
height: 450px;
}
footer {
padding: 10px 0px 10px 0px;
width: 100%;
text-align: center;
height: 110px;
}
</style>
</head>
URL: http://skyaccess.se/forum/misc.php?page=hdppvs
I can't seem to center the navigation bar text. Can someone please correct this?
Also, I'm trying to learn CSS so if anyone could show me a great site, I'd be very thankful. Considering paying $29/mo are some interaction website with points.
add float:left in your css:
section#main nav {
background: url("./images/navBG.png") repeat-x;
width: 100%;
height: 35px;
text-align: center;
float: left;
also add this css for create gaping between navigation: "padding-right: 40px;".
section#main nav a.link {
font-family: "Century Gothic";
text-decoration: none;
color: white;
font-size: 25px;
vertical-align: top;
float: center;
padding-right: 40px;

fixed size header in css styles

I have written this styles:
but it doesnt works well in IE
it appear in IE like this: http://fb812yh3737x2812.byethost3.com/IE.png
but i wanna be like this in chrome : http://fb812yh3737x2812.byethost3.com/chr.png
/*css template designed by AmzMohammad*/
body {
margin: 0px;
padding: 0px;
background: url(images/img01.jpg) repeat left top;
font: 14px B Nazanin, Helvetica, sans-serif;
color: #212121;
}
h1, h2, h3 {
margin-top: 0px;
}
h1 {
font-size: 3.0em;
}
h5 {
font: 45px "IranNastaliq","B Nazanin" ,Helvetica, sans-serif;
}
h7 {
margin-bottom: 0px;
font: 33px "Forte","Times New Roman (Headings CS)","Times Roman","Arial (Body CS)","Adobe Caslon Pro Bold","Agency FB","arial", Helvetica , sans-serif ;
}
h2 {
font-size: 1.8em;
}
h6 {
font-size: 1.1em;
}
h3 {
font-size: 1.4em;
}
h4 {
font-size: 1.0em;
}
p, ol, ul {
margin-bottom: 0em;
line-height: 160%;
}
a {
color: #393939;
}
a:hover {
text-decoration: none;
color: #393939;
}
a img {
border: none;
}
/* Header */
#header {
width: 900px;
height: 150px;
margin: 5px auto;
background: #393939;
}
#header a {
text-decoration: none;
color: #FFFFFF;
background: #393939;
}
/* Logo */
#logo {
float: left;
padding-left: 375px;
padding-right: 275px;
background: url(images/head.jpg) no-repeat left 100% ;
}
#logo h1, #logo p {
margin: auto;
line-height: normal;
font-weight: normal;
color: #393939;
}
#logo p {
padding-left: 0px;
}
#logo h1 {
padding: 25px 0px 0px 0px;
}
#logo h5 {
margin: 0px;
padding: 5px 0px 0px 0px;
}
#logo h7 {
margin-top: 0px;
padding: 5px 0px 0px 0px;
}
#logo h4 {
margin: 0px;
padding: 0px 0px 0px 0px;
}
#logo a {
color: #393939;
}
/* Menu */
#menu {
list-style: none;
float: left;
list-style: none;
margin: 0;
padding: 0;
width: 900px;
background: #393939;
}
#menu ul {
margin: 0px 0 0 0;
padding: 0px 0px 0px 0px;
list-style: none;
line-height: normal;
}
#menu li {
float: left;
font: 120% "B zar" ,"Adobe Arabic";
margin: 0;
padding: 0;
background: #393939;
}
#menu a {
display: block;
float: left;
margin: 0;
padding: 8px 12px;
text-decoration: none;
background: #393939;
}
#menu a:hover {
background: #cff;
color:#393939;
color:#393939;
}
#menu .first {
background: none;
}
#menu .active a {
}
/* Page */
#page {
width: 900px;
margin: 3px auto;
padding: 30px 0px;
}
/* Content */
#content {
float: left;
width: 570px;
}
.post {
margin: 0px 0px 30px 0px;
}
.post .title {
margin: 0px;
padding: 0px 0px 5px 0px;
border-bottom: #BFC9AE dashed 1px;
color: #232F01;
}
.post .title a {
color: #232F01;
}
.post .entry {
}
.post .meta {
font-weight: bold;
}
.post .byline {
margin: 0px;
color: #5E5E5E;
}
/* Sidebar */
#sidebar {
float: left;
width: 300px;
}
#sidebar-bgtop {
height: 3px;
}
#sidebar-bgbtm {
height: 3px;
}
#sidebar-content {
padding: 0px;
}
#sidebar ul {
margin: 15px;
padding: 0px;
list-style: none;
}
#sidebar li ul {
margin-bottom: 1.8em;
list-style: none;
}
#sidebar li li {
padding: 5px 0;
border-bottom: #BFC9AE dashed 1px;
}
#sidebar h2 {
padding: 4px 20px;
background: #393939;
font-size: 1.2em;
color: #FFFFFF;
}
#sidebar a {
text-decoration: none;
color: #232F01;
}
#sidebar a:hover {
text-decoration: underline;
}
#sidebar h6 {
margin: 0px;
padding: 0px 0px 0px 0px;
}
/* Search */
#search {
}
#search form {
margin-bottom: 1.8em;
padding: 0px;
}
#search fieldset {
margin: 0px;
padding: 0px;
border: none;
}
#search #s {
width: 160px;
}
/* Footer */
#footer {
clear: both;
width: 900px;
height: 50px;
margin: 0px auto 30px auto;
color: #FFFFFF;
background: #393939;
}
#footer p {
margin: 0px;
padding: 19px 0px 0px 0px;
text-align: center;
line-height: normal;
font-size: smaller;
}
#footer a {
color: #FFFFFF;
}
cheers
the html of header :
<div id="header">
<div id="logo">
<h7 align="center">Mohammad Mahmoodi</h7>
<p>Department of Computer Engineering, Faculty of Engineering, University of Isfahan</p>
</div>
<!-- end #logo -->
<div id="menu">
<ul>
<li class="first">Home</li>
<li>Teaching & Courses</li>
<li>Curriculum Vitae</li>
<li>Students</li>
<li>Research Interests</li>
<li>Publications</li>
<li>attraction point</li>
<li>Font</li>
<li>Farsi</li>
</ul>
</div>
<!-- end #menu -->
</div>
When you downloaded that font, (because I assume that's not a standard font) it may have come in .TTF format, IE doesn't always recognise these files try converting it to .EOT and embed it on the site for more modern versions of IE compatibility.
This generally only works for IE but i suppose if chrome is already recognising it you will most probably be OK for other browser

Resources