How to solve css issue to display image caption? - html

I want to display some image with caption.By default its showing image only but I want to display image with caption by default.I am giving my css and html code below :
<style type="text/css">
.caption-style-1{
list-style-type: none;
margin: 0px;
padding: 0px;
}
.caption-style-1 li{
float: left;
padding: 0px;
position: relative;
overflow: hidden;
margin-right:5px;
}
.caption-style-1 li:hover .caption{
opacity: 1;
}
.caption-style-1 .hover-effect{
margin: 0px;
padding: 0px;
float: left;
width:220px;
height:150px;
//background-color:#999;
margin-bottom:5px;
}
.hover-effect img{
margin: 0px;
padding: 0px;
float: left;
z-index: 4;
}
.hover-effect h1
{
font-size:20px;
border:solid 1px red;
}
.hover-effect p
{
font-size:13px;
margin:0;
padding:0;
}
.caption-style-1 .caption{
cursor: pointer;
position: absolute;
opacity: 0;
-webkit-transition:all 0.45s ease-in-out;
-moz-transition:all 0.45s ease-in-out;
-o-transition:all 0.45s ease-in-out;
-ms-transition:all 0.45s ease-in-out;
transition:all 0.45s ease-in-out;
}
.caption-style-1 .blur{
//background-color: rgba(0,0,0,0.65);
height: 150px;
width: 220px;
z-index: 5;
position: absolute;
}
.caption-style-1 .caption-text h1{
text-transform: uppercase;
font-size: 10px;
}
.caption-style-1 .caption-text .blur{
z-index: 10;
color: #fff;
position: absolute;
width: 220px;
height: 150px;
text-align: center;
background-color: rgba(0,0,0,0.65);
}
/** Nav Menu */
ul.nav-menu{
padding: 0px;
margin: 0px;
list-style-type: none;
width: 490px;
margin: 60px auto;
}
ul.nav-menu li{
display: inline;
margin-right: 10px;
padding:10px;
border: 1px solid #ddd;
}
ul.nav-menu li a{
color: #eee;
text-decoration: none;
text-transform: uppercase;
}
ul.nav-menu li a:hover, ul.nav-menu li a.active{
color: #2c3e50;
}
.opacity
{
opacity:0.2;
filter:alpha(opacity=20); /* For IE8 and earlier */
}
</style>
And my html code's are given below :
<ul class="caption-style-1">
<li>
<div class="hover-effect">
<div class="opacity"><img src="img/chaps_1x.jpg" width="220px" height="150px" alt=""></div>
<h1>Amazing Caption</h1>
<p>Whatever It Is - Always Awesome</p>
</div>
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<img src="img/chaps_1x.jpg" width="220px" height="150px" alt="">
</div>
</div>
</li>
</ul>
Any Idea?

Your HTML code is not written in well manner. If you using HTML5 then you may use HTML5 tags like figcaption with figure. The Caption tag is not showing in your style because they are behind the image.
So here is the way to move to front using z-index property.
.hover-effect h1
{
font-size:20px;
border:solid 1px red;
position:fixed;
z-index:999;
}
.hover-effect p
{
font-size:13px;
margin:0;
padding:0;
position:fixed;
z-index:999;
}
Here is the Demo. http://jsbin.com/yegiyico/1/

Related

NAV menu doesn't appear on top

How do i make my nav menu permanently on top? I have two nav menu's on a page - a main hamburger nav menu that clicks and pops up, and then an embedded page nav menu
I would like the hamburger nav menu to be permanently on top, but for some reason the embedded nav menu appears through.
Here is a codepen of the issue: https://codepen.io/TheGreatEscape/pen/ebYgGO
Here is a short youtube video if the issue: https://youtu.be/sWzCLOzRJUQ
and the related CSS Code:
/*===== NAV BUTTONS ===*/
#menu-button{ display:none}
a {
-webkit-transition: .3s all ease;
-o-transition: .3s all ease;
transition: .3s all ease;
}
a:hover, a:active, a:focus {
outline: none;
float:none;
clear:both;
text-align:center;
display:inline-block;
position:absolute;
left:0;
right:0 }
.templateux-navbar {
position: fixed;
top: 0px;
left: 0;
width: 100%;
padding: 0;
z-index: 99999;
}
.templateux-navbar .container-fluid {
max-width: 100%;
}
.templateux-navbar .toggle-menu {
z-index: 9999;
}
.templateux-navbar .templateux-menu {
top:35px;
float:none;
clear:both;
text-align:center;
display:inline-block;
position:absolute;
right:210px
}
.templateux-navbar .templateux-menu ul {
position:relative;
float:right;
margin-bottom: 0;
margin-top: 18.5px;
right:178px;
}
.templateux-navbar .templateux-menu ul li {
display: block;
}
.templateux-navbar .templateux-menu ul li a {
left:30px;
top:.5px;
text-decoration: none;
border-radius:0; border:none;
line-height:40px;
display:block;
margin-right: 0px;
font-size: 13px;
text-transform: uppercase;
letter-spacing: .05em;
color: #1a1a1a;
position: relative;
padding-bottom: 5px;
}
.templateux-navbar .templateux-menu ul li a:before {
content: "";
position: absolute;
bottom: 6px;
height: 3px;
width: 0;
left: 0px;
background: #f70f4d;
-webkit-transition: .45s width ease;
-o-transition: .45s width ease;
transition: .45s width ease;
}
.templateux-navbar .templateux-menu ul li a:hover:before {
width: 100%;
}
.templateux-navbar .templateux-menu ul li a:hover {
text-decoration: none;
background-color: inherit;
border:none;
color:#1a1a1a;
font-weight:bold
}
.templateux-navbar .templateux-menu ul li h5 {
position: absolute;
text-decoration: none;
background-color: inherit;
left: 125px;
top: -8px;
color:#1a1a1a;
font-weight:bold;
font-size: 13px;
border-radius:0;
border:none;
line-height:40px;
display: inline-block;
width: 100%;
letter-spacing: .1em;
}
.templateux-navbar .templateux-menu ul li.active > a:before {
width: 100%;
}
.templateux-navbar .templateux-menu ul li:last-child a {
margin-right: 0;
}
/*===== BACKGROUND MENU FOR MENU BUTTON, GET IN TOUCH ===*/
.menu {
width: 33px;
height: 33px;
padding: 5px;
display: block;
cursor: pointer;
position: relative;
float: right;
right: -56px;
top: 24px;
z-index: 1;
}
.menu span {
cursor: pointer;
height: 3.25px;
width: 24px;
margin-bottom: 3px;
background: #000;
position: relative;
right: 0;
display: block;
transform: rotate(0deg);
transition: .7s ease;
}
.hidden {
opacity: 0;
transition-delay: .5s;
pointer-events: none;
cursor: default;
}
.visible {
opacity: .97;
}
.menu.open span:nth-child(1) {
top: 10px;
transform: rotate(180deg);
transition: .7s ease;
background: #ffffff;
}
.menu.open span:nth-child(2) {
opacity: 0;
right: 100px;
background: #000;
}
.menu.open span:nth-child(3) {
top: 0px;
transform: rotate(-180deg);
transition: .8s ease;
background: #ffffff;
}
#navigation {
background: #000000;
font-family: 'Titling Gothic Bold';
color: rgb(0, 0, 0);
font-size: 0px;
width: 100%;
height: 450px;
text-align:left;
}
Your issue is the z-index. I fixed it by adding the class hamburger to your first .templateux-navbar element and then modified your CSS a bit. You can see the modified CSS below.
.templateux-navbar {
position: fixed;
top: 0px;
left: 0;
width: 100%;
padding: 0;
z-index: 9;
}
.templateux-navbar.hamburger {
z-index: 10;
}
Your code has this issue because you gave both the menus the same z-index so it means that the element that is defined next in the HTML will naturally get higher priority, which in your case is your second nav.
Making your hamburger menu have a higher z-index solves this issue.

How to get underline animation to only take up width of link?

Right now on hover the underline animation I've set up for my .nav extends past the link, and I want to make it so it only takes up the width of the link. The width is set to 100%, so I'm not quite sure why it's doing that. Also tried messing around with padding to see if that was the issue but didn't work. Could it be because of bootstrap?
html, body {
font-family:;
margin:0 auto;
text-transform: lowercase;
font-family: Roboto;
letter-spacing: 0.5px;
}
.nav {
float: right;
display: inline-block;
margin:0 auto;
list-style: none;
}
.nav li {
display: inline-block;
margin:0 auto;
list-style: none;
list-style: none;
display: inline;
padding-top:0;
padding-left: 10px;
}
.nav > li > a {
padding: 10px;
color: white;
font-family: Roboto;
text-decoration: none;
position: relative;
width:100%;
}
.nav > li > a:hover {
background-color:transparent;
text-decoration: none;
}
.nav > li > a:focus {
background-color:transparent;
text-decoration: none;
}
.nav > li > a:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color:white;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.nav > li > a:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
width:100%;
}
.work h1 {
border-left: 0px solid black;
padding-top:30px;
display:inline-block;
left:50%;
position: absolute;
transform: translate(-50%, -50%);
color:;
}
.work a {
color: black;
text-decoration: none;
}
.supporting .container-fluid {
background-image: url("img/photo-top.jpg");
height: 600px;
background-size: cover;
background-position: center center;
text-align: center;
position:relative;
top: 0;
width: ;
height: 100vh;
}
.work .container-fluid {
height:500px;
margin: 0 auto;
background: white);
width:100%;
padding:0;
}
.photography .container-fluid {
height:500px;
margin: 0 auto;
background: white);
width:100%;
padding:0;
}
.photography a {
border-left: 0px solid black;
padding:10px;
display:inline-block;
left:50%;
position: absolute;
transform: translate(-50%, -50%);
color:black;
}
div.container-fluid {
padding:0;
width:100%;
height: 100%;
}
.info {
position: absolute;
top: 50%;
left: calc(50% - 180px);
width: 360px;
}
.info h1 {
margin:0 auto;
color:white;
font-size: 50px;
}
.info a {
color: white;
}
.info a:hover {
color: white;
background-color:transparent;
text-decoration: none;
}
}

HTML navbar animation doesn't work

Hi guys I'm new to programming and I'm trying to build a site. I wanted a nice animation for my nabber and followed this guide (http://tobiasahlin.com/blog/css-trick-animating-link-underlines/),I want an animation in which the text gets underlined when you hover over it, but it doesn't work, why not? Did I write everything properly in the right places etc. and is it right to write you CSS in the head because I saw someone who had a separate file for the CSS code.
<head>
<style>
body{
background-color: rgb(57, 57, 57);
}
header{
background-color: white;
}
header::after{
content: " ";
display: table;
clear: both;
}
.container{
width: 95%;
margin: 0 auto;
}
.logo{
float: left;
width: 250px;
height: auto;
margin-top: 10px;
margin-bottom: 10px;
}
nav{
float: right;
font-family: 'courier';
font-size: 18px;
font-weight: 300;
letter-spacing: 0.5px;
}
nav ul{
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
}
nav li{
display: inline-block;
margin-left: 45px;
}
nav li a{
display: block;
color: black;
text-decoration: none;
padding: 17px 15px;
}
nav li a:before{
content: '';
position: absolute;
width: 100%;
bottom: 0;
left: 0;
background-color: #000;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0,3s ease-in-out 0s;
transition: all 0,3s ease-in-out 0s;
}
nav li a:hover:before{
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
</style>
</head>
<!DOCTYPE html>
<html>
<body>
<header>
<div class="container">
<img class="logo" src="file:///Users/siebe/PROJECTEN/Code/HTML/Site%20DIA/Pics/Logo%20DIA%20site.png">
<nav>
<ul>
<li>PROJECTEN</li>
<li>OVER</li>
<li>CONTACT</li>
</ul>
</nav>
</div>
</body>
</html>
Here is your error:
transition: all 0,3s ease-in-out 0s;
You have a comma (,) instead of a period (.)
In future, try this handy CSS validation service, it will point out errors for you!
CSS Validation
3 things.
1. You had an error here:
-webkit-transition: all 0,3s ease-in-out 0s;
transition: all 0,3s ease-in-out 0s;
2. "nav li a" need to have a "relative" position.
3. You did not set a height for "nav li a:before"
This works..
<head>
<style>
body{
background-color: rgb(57, 57, 57);
}
header{
background-color: white;
}
header::after{
content: " ";
display: table;
clear: both;
}
.container{
width: 95%;
margin: 0 auto;
}
.logo{
float: left;
width: 250px;
height: auto;
margin-top: 10px;
margin-bottom: 10px;
}
nav{
float: right;
font-family: 'courier';
font-size: 18px;
font-weight: 300;
letter-spacing: 0.5px;
}
nav ul{
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
}
nav li{
display: inline-block;
margin-left: 45px;
}
nav li a{
display: block;
color: black;
text-decoration: none;
padding: 17px 15px;
position: relative;
}
nav li a:before{
content: '';
position: absolute;
width: 100%;
height: 3px;
bottom: 0;
left: 0;
background-color: black;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
nav li a:hover:before{
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
</style>
</head>
<!DOCTYPE html>
<html>
<body>
<header>
<div class="container">
<img class="logo" src="file:///Users/siebe/PROJECTEN/Code/HTML/Site%20DIA/Pics/Logo%20DIA%20site.png">
<nav>
<ul>
<li>PROJECTEN</li>
<li>OVER</li>
<li>CONTACT</li>
</ul>
</nav>
</div>
</body>
</html>
In your css code try changing nav li a to nav ul li a where ever you have in the style tag. That way your <a> tag can get the proper style.
nav li a would refer to a link in a list item in a navbar
nav ul li a would refer to a link in a list item in a list in a navbar
body{
background-color: rgb(57, 57, 57);
}
header{
background-color: white;
}
header::after{
content: " ";
display: table;
clear: both;
}
.container{
width: 95%;
margin: 0 auto;
}
.logo{
float: left;
width: 250px;
height: auto;
margin-top: 10px;
margin-bottom: 10px;
}
nav{
float: right;
font-family: 'courier';
font-size: 18px;
font-weight: 300;
letter-spacing: 0.5px;
}
nav ul{
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
}
nav li{
display: inline-block;
margin-left: 45px;
}
nav li a{
display: block;
color: black;
text-decoration: none;
padding: 17px 15px;
}
nav li a:after{
display:block;
content: '';
border-bottom: solid 3px #019fb6;
transform: scaleX(0);
transition: transform 250ms ease-in-out;
}
nav li a:hover:after{
transform: scaleX(1);
}
<header>
<div class="container">
<img class="logo" src="file:///Users/siebe/PROJECTEN/Code/HTML/Site%20DIA/Pics/Logo%20DIA%20site.png">
<nav>
<ul>
<li>PROJECTEN</li>
<li>OVER</li>
<li>CONTACT</li>
</ul>
</nav>
</div>
</header>
We can achieve by using border-bottom and transform css properties.

Margin/background displaying when loading on iphone

I am hoping somebody can help me with a problem I have with my own site.
Basically I am setting up media queries for a site I am working on. However, when displayed on an iphone, or similar device it is displaying a black background or margin, almost like as if there is a div with a width of 1800px or something hidden in the background.
I have tried everything I can think of to sort this out, but I'm having no luck!
I've got the site back down to a simplified version which you can view at www.creekharmonics.uk
CSS for this simplified version is below:
html,body { text-align: center;
margin: 0 auto;
background-color:#000000;
height:100%;
}
#main
{
background-color:#000000;
}
#body
{padding-bottom:500px;}
#wrapper { display: block; width:100%; margin:0px auto; }
#headerbg
{
margin-left: auto;
margin-right: auto;
background-color:#000000;
width:100%;
height:312px;
z-index:999;
}
#headerimg
{
margin-left: auto;
margin-right: auto;
background-image:url(images/header.jpg);
width:358px;
height:312px;
z-index:1000;
}
#font-face {
font-family:bebasneuebold;
src: url(bebasneuebold.otf);
}
#font-face {
font-family:bebasneueregular;
src: url(bebasneueregular.otf);
}
#font-face {
font-family: bebas neue thin;
src: url(bebasneuethin.otf);
}
#delimiter { clear: both; }
.title { font-size: 11pt; font-family: verdana; font-weight: bold; }
#navigation ul {
text-align: center;
display: inline;
margin: 0;
padding: 30px 4px 30px 4px;
list-style: none;
}
#navigation ul li {
font-family:bebasneueregular, bebasneuebold;
font-size:22px;
color:#ffffff;
display: inline-block;
margin-right: -4px;
position: relative;
background: #000000;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
#navigation ul li a {
font-family:bebasneueregular, bebasneuebold;
font-size:22px;
color:#ffffff;
text-decoration:none;
display: inline-block;
margin-right: -4px;
padding: 30px 30px;
}
#navigation ul li:hover {
background: #1b9bff;
color: #fff;
}
#navigation ul li ul {
padding-top:30px;
padding-left:0px;
position: absolute;
top: 56px;
left: 0;
width: 220px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
text-align:center;
}
#navigation ul li ul a{
padding: 30px 67px;
}
#navigation ul li ul li {
background: #1b9bff;
display: block;
color: #fff;
border-bottom: 1px solid #0082e7;
}
#navigation ul li ul li:hover { background: #158eed; }
#navigation ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
#content2
{
display:block
width:100%;
background-color:#000000;
height:auto;
}
#garratt
{
background-color:#000000;
background-image:url(images/jackgarratt.jpg);
background-size:cover;
background-position: center center;
background-repeat:no-repeat;
position:relative;
top:-10px;
left:0px;
width:100%;
height:499px;
margin:0px;
padding:0px;
border-top:10px solid #000000;
display:block;
clear:both;
}
#garrattabout
{
height:300px;
width:914px;
position: relative;
top: 48%;
transform: translateY(-52%);
font-family: bebasneuebold;
font-size:72px;
color:#ffffff;
line-height:20px;
padding:0px;
text-align:center;
left:0;
right:0;
margin-left:auto;
margin-right:auto;
}
#garrattabout h1
{
font-family: bebas neue;
font-size:72px;
color:#00deff;
line-height:55px;
display: inline;
padding:0px;
}
#garrattabout h2
{
font-family: bebasneuebold;
font-size:30px;
color:#ffffff;
width:90px;
background-color:#000000;
margin-left: auto;
margin-right: auto;
line-height:15px;
font-weight:normal;
padding-top:14px;
padding-bottom:14px;
text-decoration:none;
border:2px solid #ffffff;
}
#garrattabout h3
{
font-family: helvetica;
font-size:16px;
font-weight:normal;
color:#ffffff;
line-height:20px;
padding:0px;
}
#garrattabout p
{
font-family: helvetica;
font-size:18px;
color:#ffffff;
width:850px;
margin-left: auto;
margin-right: auto;
line-height:20px;
font-weight:normal;
padding:0px;
}
#garrattabout a
{
font-family: bebasneuebold;
font-size:30px;
color:#ffffff;
width:850px;
height:200px;
background-color:#1b9bff;
margin-left: auto;
margin-right: auto;
line-height:20px;
font-weight:normal;
padding-left:20px;
padding-right:20px;
padding-top:16px;
padding-bottom:12px;
text-decoration:none;
border-bottom:4px solid #0d81db;
}
#garrattabout a:hover
{
font-family: bebasneuebold;
font-size:30px;
color:#ffffff;
width:850px;
height:200px;
background-color:#0d81db;
margin-left: auto;
margin-right: auto;
line-height:20px;
font-weight:normal;
padding-left:20px;
padding-right:20px;
padding-top:16px;
padding-bottom:12px;
text-decoration:none;
border-bottom:4px solid #0d81db;
}
#navcentre {
position: relative;
top:0px;
list-style:none;
margin-left: auto;
margin-right: auto;
padding:0px;
text-align:center;
width:968px;
z-index:1004;
}
#navcentrewidth {
position: relative;
top:0px;
border-top:1px solid #181818;
border-bottom:1px solid #181818;
list-style:none;
margin-left: auto;
margin-right: auto;
padding:0px;
text-align:center;
width:100%;
z-index:1005;
}
#media only screen
and (min-device-width: 320px)
and (max-device-width: 568px)
and (-webkit-min-device-pixel-ratio: 2) {
html,body { text-align: center;
margin: 0 auto;
background-color:#000000;
height:100%;
width:568px;
overflow:hidden;
}
#main
{
background-color:#000000;
}
#body
{padding-bottom:500px;}
#wrapper { display: block; width:568px; margin:0px auto; }
#headerbg
{
margin:0px auto;
background-color:#000000;
width:568px;
height:312px;
z-index:999;
}
#headerimg
{
margin:0px auto;
background-image:url(images/header.jpg);
width:358px;
height:312px;
z-index:1000;
}
#font-face {
font-family:bebasneuebold;
src: url(bebasneuebold.otf);
}
#font-face {
font-family:bebasneueregular;
src: url(bebasneueregular.otf);
}
#font-face {
font-family: bebas neue thin;
src: url(bebasneuethin.otf);
}
#delimiter { clear: both; }
.title { font-size: 11pt; font-family: verdana; font-weight: bold; }
#navigation ul {
text-align: center;
display: inline;
margin: 0;
padding: 30px 4px 30px 4px;
list-style: none;
}
#navigation ul li {
font-family:bebasneueregular, bebasneuebold;
font-size:22px;
color:#ffffff;
display: inline-block;
margin-right: -4px;
position: relative;
background: #000000;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
#navigation ul li a {
font-family:bebasneueregular, bebasneuebold;
font-size:22px;
color:#ffffff;
text-decoration:none;
display: inline-block;
margin-right: -4px;
padding: 30px 30px;
}
#navigation ul li:hover {
background: #1b9bff;
color: #fff;
}
#navigation ul li ul {
padding-top:30px;
padding-left:0px;
position: absolute;
top: 56px;
left: 0;
width: 220px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
text-align:center;
}
#navigation ul li ul a{
padding: 30px 67px;
}
#navigation ul li ul li {
background: #1b9bff;
display: block;
color: #fff;
border-bottom: 1px solid #0082e7;
}
#navigation ul li ul li:hover { background: #158eed; }
#navigation ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
#content2
{
display:block
width:568px;
background-color:#000000;
height:auto;
}
#garratt
{
background-color:#000000;
background-image:url(images/jackgarratt.jpg);
background-size:cover;
background-position: center center;
background-repeat:no-repeat;
position:relative;
top:-10px;
left:0px;
width:568px;
height:499px;
margin:0px;
padding:0px;
border-top:10px solid #000000;
display:block;
clear:both;
}
#garrattabout
{
height:300px;
width:400px;
position: relative;
top: 48%;
transform: translateY(-52%);
font-family: bebasneuebold;
font-size:40px;
color:#ffffff;
line-height:20px;
padding:0px;
text-align:center;
left:0;
right:0;
margin-left:auto;
margin-right:auto;
}
#garrattabout h1
{
font-family: bebas neue;
font-size:72px;
color:#00deff;
line-height:55px;
display: inline;
padding:0px;
}
#garrattabout h2
{
font-family: bebasneuebold;
font-size:30px;
color:#ffffff;
width:90px;
background-color:#000000;
margin-left: auto;
margin-right: auto;
line-height:15px;
font-weight:normal;
padding-top:14px;
padding-bottom:14px;
text-decoration:none;
border:2px solid #ffffff;
}
#garrattabout h3
{
font-family: helvetica;
font-size:16px;
font-weight:normal;
color:#ffffff;
line-height:20px;
padding:0px;
}
#garrattabout p
{
font-family: helvetica;
font-size:18px;
color:#ffffff;
width:400px;
margin-left: auto;
margin-right: auto;
line-height:20px;
font-weight:normal;
padding:0px;
}
#garrattabout a
{
font-family: bebasneuebold;
font-size:30px;
color:#ffffff;
width:400px;
height:200px;
background-color:#1b9bff;
margin-left: auto;
margin-right: auto;
line-height:20px;
font-weight:normal;
padding-left:20px;
padding-right:20px;
padding-top:16px;
padding-bottom:12px;
text-decoration:none;
border-bottom:4px solid #0d81db;
}
#garrattabout a:hover
{
font-family: bebasneuebold;
font-size:30px;
color:#ffffff;
width:400px;
height:200px;
background-color:#0d81db;
margin-left: auto;
margin-right: auto;
line-height:20px;
font-weight:normal;
padding-left:20px;
padding-right:20px;
padding-top:16px;
padding-bottom:12px;
text-decoration:none;
border-bottom:4px solid #0d81db;
}
#navcentre {
position: relative;
top:0px;
list-style:none;
margin-left: auto;
margin-right: auto;
padding:0px;
text-align:center;
width:568px;
z-index:1004;
}
#navcentrewidth {
position: relative;
top:0px;
border-top:1px solid #181818;
border-bottom:1px solid #181818;
list-style:none;
margin-left: auto;
margin-right: auto;
padding:0px;
text-align:center;
width:568px;
z-index:1005;
}
}
Header HTML is below:
<html>
<head>
<a name="top"></a>
<title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?> </title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '226562807717253',
xfbml : true,
version : 'v2.6'
});
};
(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_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div id="wrapper">
<div id="headerbg">
<div id="headerimg">
</div>
</div>
<div id="navcentrewidth">
<div id="navcentre">
<div id="navigation">
<ul><li>Home</li>
<li>News</li>
<li>
Reviews
<ul>
<li>Global</li>
<li>Underground</li>
<li>Gear</li>
<li>Live</li>
</ul>
</li>
<li>
Community
<ul>
<li>Facebook</li>
<li>Twitter</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!-- .main -->
</div>
Index code is here:
<?php get_header(); ?>
<div id="content2">
<div id="garratt">
<div id="garrattabout">
<h2>Global</h2>
<br/>
Jack Garratt - Phase
<p>Phase takes risks and most of them are pulled off with class and distinction, it’s fun, it’s largely original and it’s one I, nor anybody can claim to know inside out in it’s youth- that time will come. In all, Jack Garratt’s debut is immense, driven, sexy, mad- but most of all, fearless.</p>
<br/>
<p>Read More</p>
</div>
</div>
</div>
This is how it currently loads on an iphone:
iphone image
This is how I want it to load:
without black background
This is the first website I have created from scratch using Wordpress, so it's been a constant learning curve and I am sure there are things I should have done differently, but this is one hurdle I just can't seem to get over!
Any help would be really appreciated.
You can set an appropriate zoom level using a meta tag. Put this into your head:
<meta name="viewport" content="width=586">
This tells the phone to treat the viewport as 586 pixels wide, which matches your content.
More info here https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html
And loads more here http://www.quirksmode.org/mobile/metaviewport/

Links in Fixed Footer not clickable

I am working on an site where I made an fixed footer which I never did before. I got the basic code from this tutorial: http://tutorialzine.com/2013/08/slideout-footer-css/ the links work in there but as my site also got an Fixed header It messes up a bit. The links arent hoverable or clickable. How can I make my links clickable It is not that they worked when I even copyd the code in to check if the links would work then they didnt either.
Header:
<header>
<nav>
<div class="FSG-box">
<img id="FSG-logo" src="imgs/FSG.png"/>
</div>
<ul class="menu">
<li><strong>Home</strong></li>
<li>partners</li>
<li>education</li>
<li>about</li>
<li>contact</li>
</ul>
</nav>
<section id="intro">
<div class="transparent">
</div>
<div class="boxhome">
<h1>Welcome at the Food Safety Group</h1>
<div class="line1"></div>
<div class="line2"></div>
<div class="line3"></div>
</div>
</section>
</header>
Header CSS:
section {
overflow: hidden; height: 900px;
}
nav{
width: 100%;
height: 100px;
background-color: #f4f4f4;
left: 0;
top: 0;
position: fixed;
z-index: 10000;
}
.menu{
float: right;
position: relative;
right: 100px;
top:15px;
}
.menu li:hover
{
-webkit-transform:scale(1.3);
transform:scale(1.3);
}
.menu li{
color: #000;
font-weight: 300;
list-style: none;
text-decoration: none;
float: left;
margin-left: 25px;
font-size: 18px;
-webkit-transition: all 0.7s ease;
transition: all 0.7s ease;
}
#FSG-logo{
position: absolute;
top:13px;
left:13px;
max-width:450px;
}
.transparent {
position: absolute;
background-color: #000;
opacity: 0.625;
filter: alpha(opacity=60); /* For IE8 and earlier */
width: 100%;
height: 100%;
}
.boxhome:hover{
-webkit-transform:scale(1.05);
transform:scale(1.05);
height: 100%;
}
.boxhome {
width:100%;
margin:0 auto;
-webkit-transition: all 0.7s ease;
transition: all 0.7s ease;
}
#intro {
z-index: 10;
/* sets it above .slide1 */
/* this pushes it below .slide1 in the scroll */
min-height:1100px;
max-height: 1200px;
position: absolute;
width: 100%;
left: 0;
top:0;
background: url(../imgs/kassen.jpg);
}
#intro h1 {
font-size: 36pt;
text-align:center;
position: relative;
font-weight: 400;
top:320px;
}
Footer + Div above HTML:
<article class="result">
<div class="transparent2">
</div>
<div class="power">
<h2>The result of a well organized group</h2>
<h3>The six partners in this group can supply all automation required to produce a plant, harvest the product and supply the product safe and sound to the supermarket.</h3>
</div>
</article>
<footer>
<ul>
<li>
<p class="home">Where to Find Us</p>
<ul>
<li>Visser Horti Systems</li>
<li>Postoffice box 5103</li>
<li>3295 ZG 's-Gravendeel</li>
<li>The Netherlands</li>
</ul>
</li>
<li>
<p class="services">Sign up for our News Letter</p>
<ul>
<li>3D modeling</li>
<li>Web development</li>
<li>Mobile development</li>
<li>Web & Print Design</li>
</ul>
</li>
<li>
<p class="reachus">Reach us</p>
<ul>
<li><a style="cursor: pointer;" href="http://www.google.com/maps/ms?ie=UTF8&hl=nl&msa=0&msid=117943608112586518975.00000111c1da021ca60eb&om=1&t=h&z=17&ll=51.787568" target="_blank">Google Maps</a></li>
<li>Phone: +31 (0) 78 673 9800</li>
<li>Fax: +31 (0) 78 673 3434</li>
<li>info#visser.eu</li>
</ul>
</li>
</ul>
</footer>
Footer CSS:
.result {
min-height: 750px;
width: 100%;
left: 0px;
position: absolute;
background: url('../imgs/result.jpg') no-repeat scroll center center transparent;
top: 2830px;
z-index:1;
}
footer{
height:400px;
width: 100%;
position: relative;
z-index:-2;
background-color: #303030;
}
footer > ul{
width:50%;
position:fixed;
left:50%;
bottom:0;
margin-left:-480px;
padding-bottom: 200px;
z-index:-1;
}
footer > ul > li{
width:33.3%;
float:left;
}
footer ul{
list-style: none;
}
/* The links */
footer > ul > li ul li{
text-transform: uppercase;
font-weight:bold;
line-height:1.8;
}
footer > ul > li ul li a{
text-decoration: none !important;
color: #fff !important;
}
footer > ul > li ul li a:hover{
color:#fff !important;
}
footer a.logo{
color: #fff !important;
text-decoration: none !important;
font-size: 14px;
font-weight: bold;
position: relative;
text-transform: uppercase;
margin-left: 16px;
display: inline-block;
margin-top: 7px;
}
footer a.logo i{
font-style: normal;
position: absolute;
width: 60px;
display: block;
left: 48px;
top: 18px;
font-size: 12px;
color: #fff;
}
footer a.logo:before{
content: '';
display: inline-block;
background: url('../img/sprite.png') no-repeat -19px -70px;
width: 48px;
height: 37px;
vertical-align: text-top;
}
footer p{
width: 90%;
margin-right: 10%;
padding: 9px 0;
line-height: 18px;
background-color: #058cc7;
font-weight: bold;
font-size: 14px;
color:#fff;
text-transform: uppercase;
text-shadow: 0 1px rgba(0,0,0,0.1);
box-shadow: 0 0 3px rgba(0,0,0,0.3);
margin-bottom: 20px;
opacity:0.9;
cursor:default;
-webkit-transition: opacity 0.4s;
-moz-transition: opacity 0.4s;
transition: opacity 0.4s;
}
footer > ul > li:hover p{
opacity:1;
}
footer p:before{
content: '';
display: inline-block;
background: url('../img/sprite.png') no-repeat;
width: 16px;
height: 18px;
margin: 0 12px 0 15px;
vertical-align: text-bottom;
}
footer p.home{
background-color: #F58020;
}
footer p.home:before{
background-position: 0 -110px;
}
footer p.services{
background-color: #F58020;
}
footer p.services:before{
background-position: 0 -129px;
}
footer p.reachus{
background-color: #F58020;
}
footer p.reachus:before{
background-position: 0 -89px;
}
z-indexon all divs like the .result fixed the problem