Hi all,
I am playing a bit arround with media queries. In a test page I have the following CSS:
@charset "utf-8";
/* CSS Document */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html, body {
width: 100%;
height: 100%;
}
/********************
HTML
********************/
body:before {
content:'';
height:100%;
float:left;
width:0;
margin-top:-32767px;
}
body {
font-family: Arial, Helvetica, sans-serif;
line-height: 1;
font-size: 100%;
background: #0000;
color: #000;
}
#bg {
position:fixed;
top:-35%;
left:-50%;
width:200%;
height:200%;
z-index: -999;
}
#bg img {
max-width: 100%;
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
margin:auto;
min-width:50%;
min-height:50%;
}
@media only screen
and (min-device-width : 1025px){
/********************
CONTAINERS
********************/
#wrapper {
width: 100%;
max-width: 1060px;
height: 100%;
min-height: 100%;
margin: -42px 0 0;
position: relative;
overflow: hidden;
}
#wrapper:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
#footer_panel {
width: 100%;
max-width: 1060px;
height: 42px;
position: relative;
clear: both;
z-index: 200px;
font-size: .875em;
}
/********************
HEADER
********************/
#header {
width: 98.11320754716981%;
max-width: 1040px;
position: absolute;
top: 0;
left: 20px;
overflow: hidden;
border-top: 42px solid #FFF;
z-index: 100;
clear: both;
}
#header #logo {
width: 260px;
margin: 20px 0 0 0;
float: left;
}
#header #logo a {
width: 260px;
height: 58px;
display: block;
margin: 0;
text-indent: -9999em;
text-transform: uppercase;
background: url(../images/site/logo_1040.png) 0 0 no-repeat;
}
#header #languages {
margin-top: 20px;
display: inline-block;
float: right;
}
#header #languages li {
float: left;
}
#header #languages li + li {
margin-left: 5px;
}
#header #languages li a {
text-decoration: none;
color: #FFF;
font-weight: bold;
}
/********************
CONTENT
********************/
#main {
width: 100%;
max-width: 1060px;
min-height: 1px;
margin: 20px 0 0 0;
display: inline-block;
vertical-align: middle;
position: relative;
z-index: 4;
overflow: hidden;
}
#sidebar {
width: 25%;
max-width: 260px;
padding: 40px 0;
position: relative;
float: left;
z-index: 1;
vertical-align: top;
}
.sidebar {
width: 25%;
max-width: 258px;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
left: 20px;
z-index: 0;
border-right: solid 2px #F6491F;
background: #FFF;
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
}
#mask {
width: 75%;
max-width: 780px;
position: absolute;
overflow: hidden;
top: 0;
bottom: 0;
left: 280px;
}
#content {
width: 100%;
max-width: 780px;
padding: 40px 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
display: none;
z-index: 1;
overflow: hidden;
background: #FFF;
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
}
#menu {
width: 90.38461538461538%;
max-width: 235px;
margin: 0 0 0 25px;
overflow: hidden;
}
#menu li {
width: 100%;
line-height: 30px;
}
#menu a {
color: #333;
text-decoration: none;
display: block;
font-size: 1.1em;
text-indent: 20px;
}
#menu a:hover {
color: #F6491F;
}
#menu a:active {
background-position: 0 -540px;
}
#content h1 {
padding: 0 40px 20px;
font-size: 1.5em;
}
#content p {
margin: 0 40px;
font-size: 1em;
text-align: justify;
}
#content p + p {
margin: 15px 40px 0;
}
#footer_panel #footer {
width: 98.11320754716981%;
max-width: 1040px;
height: 42px;
line-height: 42px;
margin-left: 20px;
background: #000;
color: #FFF;
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
filter: alpha(opacity=80);
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
position: relative;
z-index: 100;
overflow: hidden;
}
#footer_panel #footer p {
margin-left: 30px;
}
}
@media only screen
and (min-device-width : 480px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/********************
CONTAINERS
********************/
#wrapper {
width: 100%;
max-width: 600px;
height: 100%;
min-height: 100%;
margin: -20px 0 0;
position: relative;
overflow: hidden;
}
#wrapper:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
#footer_panel {
width: 100%;
max-width: 600px;
height: 20px;
position: relative;
clear: both;
z-index: 200px;
font-size: .875em;
}
#header {
width: 98%;
max-width: 588px;
position: absolute;
top: 0;
left: 2%;
overflow: hidden;
border-top: 20px solid #FFF;
z-index: 100;
clear: both;
}
#header #logo {
width: 147px;
margin: 10px 0 0 0;
float: left;
}
#header #logo a {
width: 147px;
height: 33px;
display: block;
margin: 0;
text-indent: -9999em;
text-transform: uppercase;
background: url(../images/site/logo_600.png) 0 0 no-repeat;
}
#main {
width: 98%;
max-width: 588px;
min-height: 1px;
margin: 10px 0 0 0;
display: inline-block;
vertical-align: middle;
position: relative;
z-index: 4;
overflow: hidden;
}
#sidebar {
width: 25%;
max-width: 147px;
padding: 40px 0;
position: relative;
float: left;
z-index: 1;
vertical-align: top;
}
.sidebar {
width: 25%;
max-width: 145px;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
left: 20px;
z-index: 0;
border-right: solid 2px #F6491F;
background: #FFF;
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
}
#menu {
width: 90.38461538461538%;
max-width: 133px;
margin: 0 0 0 14px;
overflow: hidden;
}
#menu li {
width: 100%;
line-height: 30px;
}
#menu a {
color: #333;
text-decoration: none;
display: block;
font-size: 1.6em;
text-indent: 20px;
}
#menu a:hover {
color: #F6491F;
}
#menu a:active {
background-position: 0 -540px;
}
#mask {
width: 75%;
max-width: 441px;
position: absolute;
overflow: hidden;
top: 0;
bottom: 0;
left: 147px;
}
#content {
width: 75%;
max-width: 441px;
padding: 40px 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
display: none;
z-index: 1;
overflow: hidden;
background: #FFF;
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
}
#content h1 {
padding: 0 20px 10px;
font-size: 2em;
}
#content p {
margin: 0 20px;
font-size: 1.6;
text-align: justify;
}
#content p + p {
margin: 15px 20px 0;
}
#footer_panel #footer {
width: 98%;
max-width: 588px;
height: 20px;
line-height: 20px;
margin-left: 2%;
background: #000;
color: #FFF;
zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
filter: alpha(opacity=80);
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
position: relative;
z-index: 100;
overflow: hidden;
}
#footer_panel #footer p {
margin-left: 15px;
}
}
and I added the metatag <meta name=“viewport” width=“device-width” /> to the page.
When I tested the page on my laptop everything is like declared in the first media query:
@media only screen
and (min-device-width : 1025px){
}
But testing it on the IPAD gives me just a black screen. What is wrong? Is it the order in which the media queries are placed the stylesheet or is it something completely different?