Footer won't stay at bottom below content despite sticky footer - footer

I can't seem to get the header and footer to span across a mobile device such as iPhone, and the footer won't stick to the bottom. I've tried a meta code such as this:
My CSS mobile:
#charset "utf-8";
#logo {
left: 5%;
}
#navMenu {
position: relative;
left: 5%;
}
#content {
position: relative;
width: 95%;
height: 600px;
left: 2px;
right: 2px;
}
#footer {
position: fixed;
bottom: 0;
z-index: 5;
}
I've added this to the HTML meta:
meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0 maximum-scale=1.0,
Here is my desktop CSS incase something may override my mobile:
#header {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 45px;
z-index: 1;
box-shadow: 0px 0px 0px 1px rgba(82, 82, 82, 0.2);
background-color: rgba(234,234,234,1);
}
#navMenu {
position: absolute;
left: 55%;
top: 55px;
width: 325px;
height: 39px;
z-index: 3;
}
#logo {
position: absolute;
left: 20%;
top: 95px;
width: 300px;
height: 85px;
z-index: 1;
}
#pageLocation {
position: absolute;
right: 20%;
top: 240px;
width: 69px;
height: 25px;
z-index: 5;
color: rgba(50,153,204,0.1);
}
#content {
position: absolute;
right: 20%;
top: 270px;
height: 600px;
width: 60%;
padding: 10px;
margin-bottom: 50px;
z-index: 2;
border-bottom-color: rgba(50,153,204,0.2);
border-bottom-width: thin;
border-bottom-style: solid;
border-radius: 5px;
background-color: rgba(204,204,204,.1);
border-right-width: thin;
border-right-style: solid;
border-right-color: rgba(204,204,204,0.2);
border-left-width: thin;
border-left-style: solid;
border-left-color: rgba(50,153,204,0.2);
box-shadow: 0px .5px .5px .5px #333;
}
#footer {
position: absolute;
alignment: center;
bottom: 0;
left: 0;
width: 100%;
height: 50px;
z-index: 1;
text-align: center;
padding: 2px;
font-size: 12px;
line-height: 2px;
box-shadow: 0px 0px 3px 0px #333;
background-color: rgba(204,204,204,.7);
}
I've tried sticky footer techniques with no luck. I've gotten the footer with this method to stick to the bottom, but it just overlaps content when I scroll back up. Please help, this is very frustrating to get a simple iPhone/android capable footer that sits at the bottom of the page.

Related

CSS custom properties in an absolutely positioned pseudo-element

This absolutely positioned pseudo-element has a position:relative parent. We should expect its border styles to be applied, but they are not. Why?
:root {
--color-border: #E5E5E5;
--color-background: #FFFFFF;
}
.tooltip {
position: relative;
border-radius: 3px;
padding: 16px;
border: 1px solid var(--color-border);
background-color: var(--color-background);
}
.tooltip::after {
position: absolute;
top: 11px;
right: 100%;
left: -8px;
display: block;
width: 8px;
height: 16px;
pointer-events: none;
content: "";
clip-path: polygon(0 50%, 100% 0, 100% 100%);
border-width: 1px;
border-style: solid;
border-color: var(--color-border);
background-color: #ffffff;
}
.tooltip-hard-coded {
position: relative;
border-radius: 3px;
padding: 16px;
border: 1px solid #e5e5e5;
background-color: #ffffff;
}
.tooltip-hard-coded::after {
position: absolute;
top: 11px;
right: 100%;
left: -9px;
display: block;
width: 8px;
height: 16px;
pointer-events: none;
content: "";
clip-path: polygon(0 50%, 100% 0, 100% 100%);
border-width: 1px;
border-style: solid;
border-color: red;
background-color: pink;
}
<div style="display: flex; flex-direction: column">
<div style="padding: 32px;">
<div class="tooltip">With CSS variables</div>
</div>
<div style="padding: 32px;">
<div class="tooltip-hard-coded">With hard-coded values</div>
</div>
</div>
<div class="tooltip">Hi</div>
no border with the following CSS:
:root {
--color-border: #E5E5E5;
--color-background: #FFFFFF;
}
.tooltip {
position: relative;
border-radius: 3px;
padding: 16px;
border: 1px solid var(--color-border);
background-color: var(--color-background);
}
.tooltip::after {
position: absolute;
top: 11px;
right: 100%;
left: -8px;
display: block;
width: 8px;
height: 16px;
pointer-events: none;
content: "";
clip-path: polygon(0 50%, 100% 0, 100% 100%);
border-width: 1px;
border-style: solid;
border-color: var(--color-border);
background-color: var(--color-background);
}
when hard-coding a border color value, the pseudo-element only gets the style partially applied:
<div class="tooltip-hard-coded">With hard-coded values</div>
with hard-coded values:
<div class="tooltip-hard-coded">With hard-coded values</div>
What is the correct way to apply border styles to an absolutely positioned pseudo-element using CSS custom properties?
Tried several variations of the styles applied to pseudo-element; tried hard-coded values, tried changing display methods, etc

How to get desired view of the icon using JQuery mobile?

I wark on my Mobile project and I use jquery mobile library version 1.4.5.
I have this png image:
Here is the CSS:
.ui-icon-measure {
background-image: url(img/length_measure.png);
}
#measureControl {
position: absolute;
left: 10px;
top: 3em;
width: 40px;
z-index: 9999;
}
#measureButton .ui-icon {
width: 30px;
height: 30px;
top: 13px;
right: 13px;
background-color: transparent;
background-position: center;
}
Here is HTML code:
<div id="measureControl" data-role="controlgroup" data-type="vertical">
</div>
Here how it looks in the view:
But I want it to be like that:
Any idea what do I have to change in the code above to get desired view?
The code below will produce this:
.ui-icon-measure:after {
background: url(img/length_measure.png) no-repeat !important;
}
#measureControl a {
padding: 20px;
}
#measureControl {
position: absolute;
left: 10px;
top: 3em;
width: 40px;
z-index: 9999;
border-radius: 13px;
}

My web on iPad, iPhone, iPod [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
i'm creating my first web site and it's going great, looks good, and works properly. The problem i have is that i just uploaded the files to the web hosting to see how is it looking across different devices, looks great on my Smart TV, on my Android phone, on the MacBook, BUT on the iPhone and the iPad everything looks bad.
The slider is no longer overflowing, the widht is not working, even the menu buton is gone and the nav is always showing, please i need some help with this, is there some code to add so this can work on IOs movile devices?
I been looking the internet for hours trying to find the solution, i found something that includes this code:
-webkit-appearance: none;
But nothing happens everything looks bad.Thanks in advance.
You are using CSS properties that need to be prefixed in order to work in -webkit browsers, even in newer versions, such as display:flex, justify-content, transition, flex-direction,...
The practical solution is to write normal (up to date) CSS and than run it through a tool that will add the necessary prefixes for making it compatible with most browsers. It's called auto-prefixing and you can read more about it here. Good auto-prefixing tools are connected to caniuse and can be configured for various specific needs (prefix for last three versions from each browser, or prefix for all browsers with an above X usage percentage, or combinations between the two).
Here are the auto-prefixed versions of your project's CSS files. Replace assets/css/header.css with:
*{
margin: 0;
padding: 0;
-webkit-appearance: none;
}
header{
z-index: 1000;
position: fixed;
width: 100%;
font-family: "roboto";
background-color: rgba(0, 0, 0, 0.7);
}
#btn-menu{
display: none;
}
header label{
display: none;
height: 30px;
width: 30px;
padding: 10px;
}
header label:hover{
cursor: pointer;
background-color: rgba(0, 0, 0, 0.8);
}
.menu ul{
margin: 0;
list-style: none;
padding: 0;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.menu li:hover{
background-color: rgba(0, 0, 0, 0.8);
}
.menu li a{
display: block;
padding: 20px 20px 10px 20px;
color: #fff;
text-decoration: none;
}
#media (max-width: 768px) {
header label {
height: 60px;
width: 60px;
padding: 10px;
display: block;
}
.menu{
position: absolute;
background-color: rgba(0, 0, 0, 0.7);
width: 30%;
margin-left: -30%;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
.menu ul{
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
#btn-menu:checked ~ .menu{
margin: 0;
}
}
And assets/css/body.css with:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-appearance: none;
}
body{
z-index: 500;
position: relative;
}
#logo{
padding-top: 50px;
position: absolute;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
#logo-image{
width: 100%;
max-width: 650px;
}
#containerslider{
padding-top: 59px;
position: relative;
margin: auto;
width: 100%;
max-width: 1920px;
overflow: hidden;
}
.slider{
text-align: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
width: 400%;
}
.slider .section{
display: block;
height:100%;
width: 100%;
}
.slider img{
display: block;
height: 100%;
width: 100%;
}
.btn-prev, .btn-next{
width: 50px;
height: 50px;
color: white;
font-family: sans-serif; "roboto";
background: rgba(0, 0, 0, 0.5);
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
line-height: 50px;
font-size: 22px;
text-align: center;
border-radius: 50%;
cursor: pointer;
}
.btn-prev{
left: 10px;
}
.btn-next{
right: 10px;
}
.btn-prev:hover, .btn-next:hover{
background: rgba(0, 0, 0, 0.9);
}
.space{
height: 2000px;
}

CSS3 transition problem on iOS devices

I'm trying out some webkit transitions on a site and have come across a problem on iOS devices. I have six images being given a random rotation every second. The transition works fine for five out of the six images but for some reason when using the iPad or the iPhone the sixth image disappears during the transition.
You can view the example HERE.
CSS:
.b1_needle {
width: 100%;
height: 100%;
z-index: 1;
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: -webkit-transform 0.5s ease-out;
transition: transform 0.15s linear;
}
.b2_needle {
width: 100%;
height: 100%;
z-index: 1;
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: -webkit-transform 0.5s ease-out;
transition: transform 0.15s linear;
}
.m1_needle {
width: 100%;
height: 100%;
z-index: 1;
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: -webkit-transform 0.5s ease-out;
transition: transform 0.15s linear;
}
.m2_needle {
width: 100%;
height: 100%;
z-index: 1;
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: -webkit-transform 0.5s ease-out;
transition: transform 0.15s linear;
}
.s1_needle {
width: 100%;
height: 100%;
z-index: 1;
-webkit-transform: rotate(0deg);
position: relative;
top: 6px;
transform: rotate(0deg);
-webkit-transition: -webkit-transform 0.5s ease-out;
transition: transform 0.15s linear;
}
.s2_needle {
width: 100%;
height: 100%;
z-index: 1;
-webkit-transform: rotate(0deg);
position: relative;
top: 7px;
transform: rotate(0deg);
-webkit-transition: -webkit-transform 0.5s ease-out;
transition: transform 0.15s linear;
}
Javascript:
var ranNum;
function randomFromTo(from, to){
ranNum = Math.floor(Math.random() * (to - from + 1) + from);
ranNum = ranNum + "deg";
return ranNum;
}
setInterval(function newNum(){
document.getElementById("needle_b1").style.webkitTransform = "rotate("+randomFromTo(0,293)+")";
document.getElementById("needle_b2").style.webkitTransform = "rotate("+randomFromTo(0,285)+")";
document.getElementById("needle_m1").style.webkitTransform = "rotate("+randomFromTo(0,314)+")";
document.getElementById("needle_m2").style.webkitTransform = "rotate("+randomFromTo(0,223)+")";
document.getElementById("needle_s1").style.webkitTransform = "rotate("+randomFromTo(0,130)+")";
document.getElementById("needle_s2").style.webkitTransform = "rotate("+randomFromTo(0,95)+")";
}, 2000);
I originally thought it was a memory issue but removing the transition from all but that one image doesn't make a difference. Any ideas for why this is would be happening?
Your z-index values are starting from -2. In my experience Webkit doesn't mind that you use negative values, but it seems Mobile Webkit does.
If you put a border on .b1_needle you will notice it appears below .bigOne, despite having a z-index of 100.
Start your z-indexes from 0 and then go up.
Copy and paste this CSS to verify:
#media screen and (orientation:portrait)
{
.container {
background: url(../images/back_port.jpg);
background-position: top left;
background-repeat: no-repeat;
width: 768px;
height: 1004px;
position: absolute;
top: 0px;
left: 0px;
z-index: 0;
}
.bigOne {
position: absolute;
right: 29px;
top: 21px;
background-color: #000;
border: 15px solid #999;
height: 350px;
-webkit-border-radius: 190px;
width: 350px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
.bigTwo {
position: absolute;
right: 29px;
bottom: 21px;
background-color: #000;
border: 15px solid #999;
height: 350px;
-webkit-border-radius: 190px;
width: 350px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
.midOne {
position: absolute;
right: 502px;
top: 243px;
background-color: #000;
border: 15px solid #999;
height: 218px;
-webkit-border-radius: 124px;
width: 218px;
z-index: 1;
-webkit-box-shadow: inset 0 3px 4px #000;
}
.midTwo {
position: absolute;
right: 502px;
bottom: 243px;
background-color: #000;
border: 15px solid #999;
height: 218px;
-webkit-border-radius: 124px;
width: 218px;
z-index: 1;
-webkit-box-shadow: inset 0 3px 4px #000;
}
.smallOne {
position: absolute;
top: 50px;
right: 437px;
background-color: #000;
border: 10px solid #999;
height: 128px;
-webkit-border-radius: 74px;
width: 128px;
z-index: 1;
}
.smallTwo {
position: absolute;
bottom: 50px;
right: 437px;
background-color: #000;
border: 10px solid #999;
height: 128px;
-webkit-border-radius: 74px;
width: 128px;
z-index: 1;
}
.statusBox {
position: absolute;
left: 273px;
top: 373px;
background-color: #000;
border: 10px solid #999;
border-radius: 8px;
width: 150px;
height: 237px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
.iconBox {
position: absolute;
left: 465px;
top: 463px;
width: 264px;
height: 58px;
background-color: #000;
border: 10px solid #999;
border-radius: 8px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
}
#media screen and (orientation:landscape)
{
.container {
background: url(../images/back_land.jpg);
background-position: top left;
background-repeat: no-repeat;
width: 1024px;
height: 748px;
position: absolute;
top: 0px;
left: 0px;
z-index: 0;
}
.bigOne {
position: absolute;
left: 21px;
top: 29px;
background-color: #000;
border: 15px solid #999;
height: 350px;
-webkit-border-radius: 190px;
width: 350px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
.bigTwo {
position: absolute;
right: 21px;
top: 29px;
background-color: #000;
border: 15px solid #999;
height: 350px;
-webkit-border-radius: 190px;
width: 350px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
.midOne {
position: absolute;
left: 243px;
top: 482px;
background-color: #000;
border: 15px solid #999;
height: 218px;
-webkit-border-radius: 124px;
width: 218px;
z-index: 1;
-webkit-box-shadow: inset 0 3px 4px #000;
}
.midTwo {
position: absolute;
right: 243px;
top: 482px;
background-color: #000;
border: 15px solid #999;
height: 218px;
-webkit-border-radius: 124px;
width: 218px;
z-index: 1;
-webkit-box-shadow: inset 0 3px 4px #000;
}
.smallOne {
position: absolute;
left: 50px;
top: 437px;
background-color: #000;
border: 10px solid #999;
height: 128px;
-webkit-border-radius: 74px;
width: 128px;
z-index: 1;
}
.smallTwo {
position: absolute;
right: 50px;
top: 437px;
background-color: #000;
border: 10px solid #999;
height: 128px;
-webkit-border-radius: 74px;
width: 128px;
z-index: 1;
}
.statusBox {
position: absolute;
left: 428px;
top: 99px;
background-color: #000;
border: 10px solid #999;
-webkit-border-radius: 8px;
width: 150px;
height: 237px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
.iconBox {
position: absolute;
left: 370px;
top: 380px;
width: 264px;
height: 58px;
background-color: #000;
border: 10px solid #999;
border-radius: 8px;
z-index: 1;
-webkit-box-shadow: 0 3px 4px #000;
}
}
.statusData{
width: 126px;
height: 100%;
margin-left: auto;
margin-right: auto;
}
.statusLogo{
background: url(../images/mccaLogo.png);
height: 87px;
width: 100%;
}
.digitalTxt{
font-family: 'Digital7Mono';
font-size: 32px;
color: #fff;
width: auto;
margin-left: auto;
margin-right: auto;
margin-top: 3px;
}
.statusDate{
height: 48px;
width: 100%;
border-top: 2px #999 solid;
}
.statusTime{
height: 48px;
width: 100%;
border-top: 2px #999 solid;
}
.statusLoc{
height: 48px;
width: 100%;
border-top: 2px #999 solid;
}
.b1_notch {
width: 100%;
height: 100%;
background: url(../images/b1_back.png);
background-position: center;
background-repeat: no-repeat;
z-index: 1;
}
.b1_needle {
width: 100%;
height: 100%;
z-index: 2;
-webkit-transform: rotate3d(0, 0, 0, 0deg);
transform: rotate3d(0, 0, 0, 0deg);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.b2_notch {
width: 100%;
height: 100%;
background: url(../images/b2_back.png);
background-position: center;
background-repeat: no-repeat;
z-index: 1;
}
.b2_needle {
width: 100%;
height: 100%;
z-index: 2;
-webkit-transform: rotate3d(0, 0, 0, 0deg);
transform: rotate3d(0, 0, 0, 0deg);
-webkit-transition: -webkit-transform 0.5s linear;
transition: transform 0.5s linear;
}
.m1_notch {
width: 100%;
height: 100%;
background: url(../images/m1_back.png);
background-position: center;
background-repeat: no-repeat;
z-index: 1;
}
.m1_needle {
width: 100%;
height: 100%;
z-index: 2;
-webkit-transform: rotate3d(0, 0, 0, 0deg);
transform: rotate3d(0, 0, 0, 0deg);
-webkit-transition: -webkit-transform 0.5s linear;
transition: transform 0.5s linear;
}
.m2_notch {
width: 100%;
height: 100%;
background: url(../images/m2_back.png);
background-position: center;
background-repeat: no-repeat;
z-index: 1;
}
.m2_needle {
width: 100%;
height: 100%;
z-index: 2;
-webkit-transform: rotate3d(0, 0, 0, 0deg);
transform: rotate3d(0, 0, 0, 0deg);
-webkit-transition: -webkit-transform 0.5s linear;
transition: transform 0.5s linear;
}
.s1_notch {
width: 100%;
height: 100%;
background: url(../images/s1_back.png);
background-position: center;
background-repeat: no-repeat;
z-index: 1;
}
.s1_needle {
width: 100%;
height: 100%;
z-index: 1;
position: relative;
top: 6px;
-webkit-transform: rotate3d(0, 0, 0, 0deg);
transform: rotate3d(0, 0, 0, 0deg);
-webkit-transition: -webkit-transform 0.5s linear;
transition: transform 0.5s linear;
}
.s2_notch {
width: 100%;
height: 100%;
background: url(../images/s2_back.png);
background-position: center;
background-repeat: no-repeat;
z-index: 1;
}
.s2_needle {
width: 100%;
height: 100%;
z-index: 2;
position: relative;
top: 7px;
-webkit-transform: rotate3d(0, 0, 0, 0deg);
transform: rotate3d(0, 0, 0, 0deg);
-webkit-transition: -webkit-transform 0.5s linear;
transition: transform 0.5s linear;
}

Webkit Scrollbar Error

I have a problem with my webkit scrollbar on the iPod/iPhone/iPad - the user can't scroll down. The scrollbar just looks like a floating line, and the page breaks halfway through. (It works fine in Chrome & Safari.)
Is there any way I can keep the scrollbar, but have it not be custom on apple products?
Here's my site, and here's my scrollbar code:
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
display: block;
height: 10px;
}
::-webkit-scrollbar-button:vertical:increment {
background-color: #fff;
}
::-webkit-scrollbar-track-piece {
background-color: #eee;
-webkit-border-radius: 3px;
}
::-webkit-scrollbar-thumb:vertical {
height: 50px;
background-color: #ccc;
-webkit-border-radius: 3px;
}
::-webkit-scrollbar-thumb:horizontal {
width: 50px;
background-color: #ccc;
-webkit-border-radius: 3px;
}
html {
overflow: auto;
background-color: #FAFAFA;
-webkit-font-smoothing: antialiased;
}
body {
background: #FAFAFA;
font-family: arial, serif;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 10px;
overflow-y: scroll;
overflow-x: hidden;
color: #999;
}
You might have to load that scrollbar styling code from a separate stylesheet. Move it over to a new file, lets say scrollbars.css, and attach this code to your JavaScript:
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.search('iphone') == -1 && userAgent.search('ipod') == -1)
{
$('head').append('<link rel="stylesheet" href="scrollbars.css" type="text/css" />');
}
In your site, you have these styles in the main page:
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
display: block;
height: 10px;
}
::-webkit-scrollbar-button:vertical:increment {
background-color: #fff;
}
::-webkit-scrollbar-track-piece {
background-color: #eee;
-webkit-border-radius: 3px;
}
::-webkit-scrollbar-thumb:vertical {
height: 50px;
background-color: #ccc;
-webkit-border-radius: 3px;
}
::-webkit-scrollbar-thumb:horizontal {
width: 50px;
background-color: #ccc;
-webkit-border-radius: 3px;
}
...
Take them and copy them over to a new file called scrollbars.css. Now, delete those old ones from your site completely. The JavaScript loads the scrollbar CSS file automagically.

Resources