I'm having an issue with a site I'm building.
When I use a debugger with the dimensions of my phone, everything looks great and works as it should.
When I go to the site with my smart phone, however, I just see a black, empty page...
What's going wrong?
Thanks!
http://holymothership.be/
CSS
body {
font-family:"Karla", Helvetica, Arial, sans-serif;
font-size:20px;
font-weight: 400;
color: #ffffff;
overflow: hidden;
cursor: default;
background-color: #000;
display: -webkit-box; /* OLD: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* OLD: Firefox (buggy) */
display: -ms-flexbox; /* MID: IE 10 */
display: -webkit-flex; /* NEW, Chrome 21–28, Safari 6.1+ */
display: flex; /* NEW: IE11, Chrome 29+, Opera 12.1+, Firefox 22+ */
-webkit-box-align: center;
-moz-box-align: center; /* OLD… */
-ms-flex-align: center; /* You know the drill now… */
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
margin: 0;
height: 100%;
width: 100%; /* needed for Firefox */
}
h1,h2,h3,h4,h5,h6,p {
/*line-height: 7vh;*/
}
h1 {
margin-top: -5px;
font-weight: 100;
font-size: 1.83em;
display: block;
}
h2 {
margin-top: -5px;
font-weight: 100;
font-size: 1.83em;
display: none;
}
h3 {
margin-top: -5px;
font-weight: 100;
font-size: 1.83em;
display: none;
}
a {
cursor: hand;
color: #fff;
text-decoration: none;
}
b {
font-weight: bold;
}
a:hover {
cursor: hand;
border-bottom-style: solid;
border-bottom-width: 0.3vh;
border-bottom-color: #fff;
padding-bottom: 1px;
text-decoration: none;
}
.underline {
cursor: hand;
border-bottom-style: solid;
border-bottom-width: 0.3vh;
border-bottom-color: #fff;
padding-bottom: 2px;
text-decoration: none;
}
a.footer:hover{
cursor: hand;
border-bottom-style: solid;
border-bottom-width: 0.2vh;
border-bottom-color: #fff;
padding-bottom: 0px;
text-decoration: none;
}
#work {
background-position: center center;
background-repeat: no-repeat;
background-image:url("../cover.png");
position:absolute;
left:0;
top:0;
/*background-size: contain;*/
height:600px;
width:600px;
margin: -100px;
z-index: 1;
cursor: pointer;
}
#overlay {
background-color: #000;
box-shadow: 0 0 100px #ffffff;
z-index: 9999;
position: relative;
width: 1000px;
height: 700px;
display: -webkit-box; display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center; -moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
transform: rotate(-5deg);
-ms-transform: rotate(-5deg); /* IE 9 */
-webkit-transform: rotate(-5deg); /* Chrome, Safari, Opera */
}
#header {
width:auto;
font-weight: 400;
font-family:"Karla", Helvetica, Arial, sans-serif;
color: #FFF;
position: absolute;
top: 25px;
left: 25px;
}
#footer {
width:auto;
position: absolute;
bottom:25px;
left:25px;
right:25px;
padding-bottom: -4px;
}
#links {
float:left;
position: relative;
}
#contact {
float:left;
padding-left:80px;
position: relative;
}
#secret {
color: #000;
float:right;
position:relative;
}
#logo {
position: absolute;
margin-left: -200px;
margin-top: -135px;
top: 50%;
left: 50%;
width: 400px;
height: 270px;
background-image: url("../logo.svg");
background-position: center center;
background-repeat: no-repeat;
cursor: pointer;
}
#logo1 {
float: right;
position: absolute;
width:150px;
height: auto;
bottom:25px;
right:25px;
padding-bottom: -4px;
}
#logo2 {
display: none;
}
a.secret:hover{
cursor:hand;
text-shadow: 0 0 10px #ffffff;
text-decoration: none;
border-bottom-style: none;
}
#font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?63082030');
src: url('../font/fontello.eot?63082030#iefix') format('embedded-opentype'),
url('../font/fontello.woff?63082030') format('woff'),
url('../font/fontello.ttf?63082030') format('truetype'),
url('../font/fontello.svg?63082030#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?63082030#fontello') format('svg');
}
}
*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
zoom: 0.8;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .6em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-twitter:before { content: '\e800'; } /* '' */
.icon-phone:before { content: '\e801'; } /* '' */
.icon-location:before { content: '\e802'; } /* '' */
.icon-mail:before { content: '\e803'; } /* '' */
.icon-facebook:before { content: '\e804'; } /* '' */
.icon-copy:before { content: '\e805'; } /* '' */
#font-face {
font-family: 'Avara'; /*a name to be used later*/
src: url('../font/Avara.ttf'); /*URL to font*/
}
#media only screen and (max-width: 1100px) , screen and (max-height: 840px) {
#overlay{
width: 800px;
height: 560px;
}
h1 {
font-size: 1.45em;
}
#footer {
font-size:0.8em;
}
#contact {
padding-left:60px;
}
#logo {
position: absolute;
margin-left: -150px;
margin-top: -102px;
top: 50%;
left: 50%;
width: 300px;
height: 204px;
}
#logo1 {
width: 120px;
}
#media only screen and (max-width: 920px) , screen and (max-height: 700px) {
#overlay{
width: 600px;
height: 420px;
}
h1 {
font-size: 1.06em;
}
#footer {
font-size:0.8em;
}
#contact {
padding-left:40px;
}
#logo {
position: absolute;
margin-left: -100px;
margin-top: -68px;
top: 50%;
left: 50%;
width: 200px;
height: 136px;
}
#logo1 {
width: 100px;
}
#media only screen and (max-device-width: 460px) and (orientation: portrait) {
#overlay{
width: 220px;
height: 380px;
}
#header {
top: 10px;
left: 10px;
}
h1 {
display: none;
}
h2 {
font-size: 1.0em;
display: block;
}
h3 {
display: none;
}
#footer {
font-size:0.37em;
bottom: 10px;
left: 10px;
}
#contact {
padding-left:10px;
}
#work {
display: none;
}
#logo {
display: none;
}
#logo1 {
display: none;
}
#logo2 {
width: 80px;
height: auto;
display: block;
margin-top: 265px;
left: 10px;
position: absolute;
}
#media only screen and (max-device-width: 640px) and (orientation: landscape) {
#overlay{
width: 380px;
height: 220px;
}
#header {
top: 10px;
left: 10px;
}
h1 {
display: none;
}
h2 {
display: none;
}
h3 {
font-size: 1.0em;
display: block;
}
#footer {
font-size:0.6em;
bottom: 10px;
left: 10px;
}
#contact {
padding-left:10px;
}
#work {
display: none;
}
#logo {
display: none;
}
#logo1 {
display: none;
}
#logo2 {
width: 60px;
height: auto;
display: block;
left: 310px;
bottom: 10px;
position: fixed;
float: right;
}
HTML
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Holy Mothership</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<meta name="description" content="Holy Mothership is a multidisciplinary design collective based in Antwerp, Belgium."/>
<meta name="author" content="Holy Mothership"/>
<meta name="keywords" content="Holy Mothership, graphic design, studio, antwerp, collective, print, webdesign, copy, illustration"/>
<!-- open graph -->
<meta property="og:title" content="Holy Mothership"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://holymothership.be"/>
<meta property="og:image" content="http://holymothership.be/logo-s.jpeg"/>
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="300">
<meta property="og:image:height" content="300">
<meta property="og:description" content="Holy Mothership is a multidisciplinary design collective based in Antwerp, Belgium.
It was founded by Tom Anthoni, Benny Arts, Christophe Clarijs, Elias Derboven and Ellen Pollard."/>
<meta property="fb:admins" content="1514858388765304"/>
<!-- end of open graph -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script language="JavaScript" src="js/script.js"></script>
<script language="JavaScript" src="js/jquery.js"></script>
<script language="JavaScript" src="js/matchmedia.js"></script>
<script language="JavaScript" src="js/analytics.js"></script>
<link href='http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="http://holymothership.be/favicon/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://holymothership.be/favicon/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://holymothership.be/favicon/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://holymothership.be/favicon/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="http://holymothership.be/favicon/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="http://holymothership.be/favicon/apple-touch-icon-152x152.png" />
<link rel="icon" type="image/png" href="http://holymothership.be/favicon/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="http://holymothership.be/favicon/favicon-16x16.png" sizes="16x16" />
<meta name="application-name" content="Holy Mothership"/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="msapplication-TileImage" content="http://holymothership.be/favicon/mstile-144x144.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body>
<div id="work"></div>
<div id="logo"></div>
<div id="overlay">
<div id="header">
<h1><b>Holy Mothership</b> is a multidisciplinary design collective<br>
founded by Tom Anthoni, Benny Arts,<br>
Christophe Clarijs,
Elias Derboven and Ellen Pollard.<br>
Our studio is located in Antwerp, Belgium.</h1>
<h2><b>Holy Mothership</b> is<br>
a multidisciplinary<br>
design collective<br>
founded by<br>
Christophe Clarijs,<br>
Benny Arts,<br>
Elias Derboven,<br>
Tom Anthoni and<br>
Ellen Pollard.<br>
Our studio is located in Antwerp, Belgium.</h2>
<h3><b>Holy Mothership</b> is a multidisciplinary<br>
design collective founded by<br>
Tom Anthoni, Benny Arts, Ellen Pollard,<br>
Christophe Clarijs and Elias Derboven.<br>
Our studio is located in Antwerp, Belgium.</h3>
</div>
<div id="footer">
<div id="links">
<ic class="icon-twitter"></ic>twitter <br>
<ic class="icon-facebook"></ic>facebook <br>
<ic class="icon-copy"></ic>2014
</div>
<div id="contact">
<ic class="icon-location"></ic>Marialei 29, 2018 Antwerp, Belgium<br>
<ic class="icon-mail"></ic>contact#holymothership.be<br>
<ic class="icon-phone"></ic>+32 (0)494 39 87 82
</div>
</div>
<div id="logo1">
<img src="logo1.svg">
</div>
<div id="logo2">
<img src="logo2.svg">
</div>
</div>
<div id="footer">
<div id="secret"><br><br>
The Landing of…
</div>
</div>
</body>
</html>
I edited your JSFiddle - http://jsfiddle.net/xdm6or92/ and I added two media queries for iPhone portrait and landscape mode. It's hard to test responsive page using JSFiddle, so I uploaded working example on my private server. This way you can enter page from your iPhone or other smartphone and see if it's working. Link - http://mikemoney.nazwa.pl/holymothership/.
Media queries for iPhone
/*iPhone portrait orientation for Safari */
#media only screen and (max-device-width: 460px) and (orientation: portrait) {
.iphone-portrait {
display: block;
}
}
/*iPhone portrait orientation for Safari */
#media only screen and (max-device-width: 640px) and (orientation: landscape) {
#overlay {
width: 500px;
height: 460px;
}
.iphone-landscape {
display: block;
color:blue;
}
}
Full working example [code] http://mikemoney.nazwa.pl/holymothership/.
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body {
font-family:"Karla", Helvetica, Arial, sans-serif;
font-size:20px;
font-weight: 400;
color: #ffffff;
overflow: hidden;
cursor: default;
background-color: #000;
display: -webkit-box;
/* OLD: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box;
/* OLD: Firefox (buggy) */
display: -ms-flexbox;
/* MID: IE 10 */
display: -webkit-flex;
/* NEW, Chrome 21–28, Safari 6.1+ */
display: flex;
/* NEW: IE11, Chrome 29+, Opera 12.1+, Firefox 22+ */
-webkit-box-align: center;
-moz-box-align: center;
/* OLD… */
-ms-flex-align: center;
/* You know the drill now… */
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
margin: 0;
height: 100%;
width: 100%;
/* needed for Firefox */
}
h1, h2, h3, h4, h5, h6, p {
/*line-height: 7vh;*/
}
h1 {
margin-top: -5px;
font-weight: 100;
font-size: 1.83em;
display: block;
}
h2 {
margin-top: -5px;
font-weight: 100;
font-size: 1.83em;
display: none;
}
h3 {
margin-top: -5px;
font-weight: 100;
font-size: 1.83em;
display: none;
}
a {
cursor: hand;
color: #fff;
text-decoration: none;
}
b {
font-weight: bold;
}
a:hover {
cursor: hand;
border-bottom-style: solid;
border-bottom-width: 0.3vh;
border-bottom-color: #fff;
padding-bottom: 1px;
text-decoration: none;
}
.underline {
cursor: hand;
border-bottom-style: solid;
border-bottom-width: 0.3vh;
border-bottom-color: #fff;
padding-bottom: 2px;
text-decoration: none;
}
a.footer:hover {
cursor: hand;
border-bottom-style: solid;
border-bottom-width: 0.2vh;
border-bottom-color: #fff;
padding-bottom: 0px;
text-decoration: none;
}
#work {
background-position: center center;
background-repeat: no-repeat;
background-image:url("../cover.png");
position:absolute;
left:0;
top:0;
/*background-size: contain;*/
height:600px;
width:600px;
margin: -100px;
z-index: 1;
cursor: pointer;
}
#overlay {
background-color: #000;
box-shadow: 0 0 100px #ffffff;
z-index: 9999;
position: relative;
width: 1000px;
height: 700px;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
transform: rotate(-5deg);
-ms-transform: rotate(-5deg);
/* IE 9 */
-webkit-transform: rotate(-5deg);
/* Chrome, Safari, Opera */
}
#header {
width:auto;
font-weight: 400;
font-family:"Karla", Helvetica, Arial, sans-serif;
color: #FFF;
position: absolute;
top: 25px;
left: 25px;
}
#footer {
width:auto;
position: absolute;
bottom:25px;
left:25px;
right:25px;
padding-bottom: -4px;
}
#links {
float:left;
position: relative;
}
#contact {
float:left;
padding-left:80px;
position: relative;
}
#secret {
color: #000;
float:right;
position:relative;
}
#logo {
position: absolute;
margin-left: -200px;
margin-top: -135px;
top: 50%;
left: 50%;
width: 400px;
height: 270px;
background-image: url("../logo.svg");
background-position: center center;
background-repeat: no-repeat;
cursor: pointer;
}
#logo1 {
float: right;
position: absolute;
width:150px;
height: auto;
bottom:25px;
right:25px;
padding-bottom: -4px;
}
#logo2 {
display: none;
}
a.secret:hover {
cursor:hand;
text-shadow: 0 0 10px #ffffff;
text-decoration: none;
border-bottom-style: none;
}
#font-face {
font-family:'fontello';
src: url('../font/fontello.eot?63082030');
src: url('../font/fontello.eot?63082030#iefix') format('embedded-opentype'), url('../font/fontello.woff?63082030') format('woff'), url('../font/fontello.ttf?63082030') format('truetype'), url('../font/fontello.svg?63082030#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?63082030#fontello') format('svg');
}
}
*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family:"fontello";
font-style: normal;
font-weight: normal;
speak: none;
zoom: 0.8;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .6em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-twitter:before {
content:'\e800';
}
/* '' */
.icon-phone:before {
content:'\e801';
}
/* '' */
.icon-location:before {
content:'\e802';
}
/* '' */
.icon-mail:before {
content:'\e803';
}
/* '' */
.icon-facebook:before {
content:'\e804';
}
/* '' */
.icon-copy:before {
content:'\e805';
}
/* '' */
#font-face {
font-family:'Avara';
/*a name to be used later*/
src: url('../font/Avara.ttf');
/*URL to font*/
}
.iphone-portrait, .iphone-landscape {
display: none;
color: red;
}
#media only screen and (max-device-width: 1100px), screen and (max-device-height: 840px) {
#overlay {
width: 800px;
height: 560px;
}
h1 {
font-size: 1.45em;
}
#footer {
font-size: 0.8em;
}
#contact {
padding-left: 60px;
}
#logo {
position: absolute;
margin-left: -150px;
margin-top: -102px;
top: 50%;
left: 50%;
width: 300px;
height: 204px;
}
#logo1 {
width: 120px;
}
}
#media only screen and (max-device-width: 920px), screen and (max-device-height: 700px) {
#overlay {
width: 600px;
height: 420px;
}
h1 {
font-size: 1.06em;
}
#footer {
font-size: 0.8em;
}
#contact {
padding-left: 40px;
}
#logo {
position: absolute;
margin-left: -100px;
margin-top: -68px;
top: 50%;
left: 50%;
width: 200px;
height: 136px;
}
#logo1 {
width: 100px;
}
}
#media only screen and (max-device-width: 700px), only screen and (max-device-height: 530px) {
#overlay {
width: 220px;
height: 380px;
}
#header {
top: 10px;
left: 10px;
}
h1 {
display: none;
}
h2 {
font-size: 1.0em;
display: block;
}
h3 {
display: none;
}
#footer {
font-size: 0.37em;
bottom: 10px;
left: 10px;
}
#contact {
padding-left: 10px;
}
#work {
display: none;
}
#logo {
display: none;
}
#logo1 {
display: none;
}
#logo2 {
width: 80px;
height: auto;
display: block;
margin-top: 265px;
left: 10px;
position: absolute;
}
}
#media only screen and (max-device-height: 460px) {
#overlay {
width: 380px;
height: 220px;
}
#header {
top: 10px;
left: 10px;
}
h1 {
display: none;
}
h2 {
display: none;
}
h3 {
font-size: 1.0em;
display: block;
}
#footer {
font-size: 0.6em;
bottom: 10px;
left: 10px;
}
#contact {
padding-left: 10px;
}
#work {
display: none;
}
#logo {
display: none;
}
#logo1 {
display: none;
}
#logo2 {
width: 60px;
height: auto;
display: block;
left: 310px;
bottom: 10px;
position: fixed;
float: right;
}
}
/*iPhone portrait orientation for Safari */
#media only screen and (max-device-width: 460px) and (orientation: portrait) {
.iphone-portrait {
display: block;
}
}
/*iPhone portrait orientation for Safari */
#media only screen and (max-device-width: 640px) and (orientation: landscape) {
#overlay {
width: 500px;
height: 460px;
}
.iphone-landscape {
display: block;
color:blue;
}
}
</style>
</head>
<body>
<div id="work"></div>
<div id="logo"></div>
<div id="overlay">
<div id="header">
<h1><b>Holy Mothership</b> is a multidisciplinary design collective<br>
founded by Tom Anthoni, Benny Arts,<br>
Christophe Clarijs,
Elias Derboven and Ellen Pollard.<br>
Our studio is located in Antwerp, Belgium.</h1>
<h2><b>Holy Mothership</b> is<br>
a multidisciplinary<br>
design collective<br>
founded by<br>
Christophe Clarijs,<br>
Benny Arts,<br>
Elias Derboven,<br>
Tom Anthoni and<br>
Ellen Pollard.<br>
Our studio is located in Antwerp, Belgium.</h2>
<h3><b>Holy Mothership</b> is a multidisciplinary<br>
design collective founded by<br>
Tom Anthoni, Benny Arts, Ellen Pollard,<br>
Christophe Clarijs and Elias Derboven.<br>
Our studio is located in Antwerp, Belgium.</h3>
<div class="iphone-portrait">It's portrait mode</div>
<div class="iphone-landscape">It's landscape mode</div>
</div>
<div id="footer">
<div id="links">
<ic class="icon-twitter"></ic>twitter
<br>
<ic class="icon-facebook"></ic>facebook
<br>
<ic class="icon-copy"></ic>2014</div>
<div id="contact">
<ic class="icon-location"></ic>Marialei 29, 2018 Antwerp, Belgium
<br>
<ic class="icon-mail"></ic>contact#holymothership.be
<br>
<ic class="icon-phone"></ic>+32 (0)494 39 87 82</div>
</div>
</div>
<div id="footer">
<div id="secret">
<br>
<br> The Landing of…
</div>
</div>
</body>
</html>
Related
enter image description hereSorry, another newb. requiring help, please??
I have created a site (first site for 15 years) and there are a couple of things i'd like to know but the first and most important one is, why does my site header not show on iPhones?
Android showing header
iPhone without header
I have added the viewport meta tag but it didn't change anything.
Another thing l have read on here is adding #media but it didn't say where to add it so l tried a few places without success.
Can someone help me please?
Test page code
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://fonts.googleapis.com/css?family=Roboto+Condensed:700italic,400,300,700" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script src="js/html5shiv.js"></script><![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-panels.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel-noscript.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="css/ie/v9.css" /><![endif]-->
</head>
<body class="left-sidebar">
<!-- Header -->
<div id="header">
<div class="container">
<!-- Logo -->
<div id="logo">
<h2>Dress Up Leeds Ltd</h2>
</div>
<!-- Nav -->
<nav id="nav">
<ul>
<li>home</li>
<li>store</li>
<li class="active">contact us</li>
<li>about</li>
</ul>
</nav>
</div>
</div>
style.css for header
header
{
margin-bottom: 2em;
line-height: 1.7em;
}
header h2
{
font-size: 2.5em;
}
header .byline
{
display: block;
margin: 0.5em 0 0 0;
padding: 0 0 0.5em 0;
text-transform: uppercase;
font-size: 1.4em;
}
p {
font-size: 1.1em;
}
and
#header
{
position: relative;
background: #FFF;
}
#header .container
{
position: relative;
padding: 4em 0em;
}
style-mobile.css for header
header
{
}
header h2
{
font-size: 1.6em;
}
header .byline
{
font-size: 1em;
}
and
#header
{
display: none;
}
#logo
{
display: none;
}
#nav
{
display: none;
}
style-mobile css the whole file
/*********************************************************************************/
/* Basic */
/*********************************************************************************/
body,input,textarea,select
{
line-height: 1.75em;
font-size: 11pt;
letter-spacing: 0;
}
body
{
padding-top: 44px;
}
h2, h3, h4, h5, h6
{
font-size: 1.5em;
}
section,
article
{
clear: both;
margin: 2em 0 2em 0 !important;
}
section > :first-child,
article > :first-child
{
margin-top: 0 !important;
}
section:first-child,
article:first-child
{
margin-top: 0 !important;
}
.container
{
padding: 0em 1em;
}
.button
{
display: block;
width: 100%;
text-align: center;
}
header
{
}
header h2
{
font-size: 1.6em;
}
header .byline
{
font-size: 1em;
}
/*********************************************************************************/
/* UI */
/*********************************************************************************/
#titleBar
{
background: #202020 url(images/img01.jpg) repeat;
}
#titleBar .title
{
display: block;
color: #fff;
text-align: center;
line-height: 44px;
}
#titleBar .toggle
{
position: absolute;
left: 0;
top: 0;
width: 80px;
height: 60px;
}
#titleBar .toggle:after
{
content: '';
display: block;
width: 20px;
height: 12px;
position: absolute;
left: 10px;
top: 15px;
background: url('images/toggle.svg') 0px 0px no-repeat;
opacity: 0.5;
}
#titleBar .toggle:active:after
{
opacity: 0.75;
}
#navPanel
{
background: #202020 url(images/img01.jpg) repeat;
box-shadow: inset -10px 0px 20px 0px rgba(0,0,0,0.5);
}
#navPanel .link
{
display: block;
color: #888;
text-decoration: none;
height: 44px;
line-height: 44px;
border-top: solid 1px rgba(255,255,255,0.1);
letter-spacing: 1px;
text-transform: uppercase;
padding: 0 1em 0 1em;
}
#navPanel .link:first-child
{
border-top: 0;
}
#navPanel .link.depth-0
{
color: #fff;
}
#navPanel .indent-1 { display: inline-block; width: 1em; }
#navPanel .indent-2 { display: inline-block; width: 2em; }
#navPanel .indent-3 { display: inline-block; width: 3em; }
#navPanel .indent-4 { display: inline-block; width: 4em; }
#navPanel .indent-5 { display: inline-block; width: 5em; }
#navPanel .depth-0 { color: #fff; }
/*********************************************************************************/
/* Header */
/*********************************************************************************/
#header
{
display: block;
}
#logo
{
display: block;
}
#nav
{
display: block;
}
/*********************************************************************************/
/* Banner */
/*********************************************************************************/
#banner
{
padding: 6em 0em;
}
/*********************************************************************************/
/* Main */
/*********************************************************************************/
#page
{
padding: 2em 0em 2em 0em;
}
#main
{
margin-top: 3em;
padding-top: 0em;
border-top: none;
}
.homepage #main
{
margin-top: 3em;
padding-top: 3em;
}
/*********************************************************************************/
/* Footer */
/*********************************************************************************/
#footer
{
padding: 0em 0em 2em 0em;
}
/*********************************************************************************/
/* Featured */
/*********************************************************************************/
#featured
{
position: relative;
padding: 4em 0em 2em 0em;
}
#featured .divider
{
padding: 2em 0em 0em 0em;
}
#featured .left
{
float: none;
width: 100%;
}
Try this:
#header {
display: block;
}
#logo {
display: block;
}
#nav {
display: block;
}
display: none hides elements, so your css is hiding your header. The viewport tag makes no difference in whether or not the header is hidden. I am missing context here, but your css looks like it is very intentionally hiding your header, so I am guessing it was written by someone else? If so, that person may have written it with the intent of applying these css rules for one screen size and applying a different set of rules for another screen size, but perhaps they left the task unfinished, or we are only seeing a small part of the css here. If that is the case, then you should look into using media queries to apply different sets of rules for different screen sizes.
I try to better understand how CSS works. I have the following code:
#import url('https://fonts.googleapis.com/css2?family=Raleway:wght#300;400;700;900&display=swap" rel="stylesheet');
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Raleway', sans-serif;
text-align: center;
}
img {
max-width: 100%;
height: auto;
}
.container {
width: 95%;
max-width: 70em;
margin: 0 auto;
}
/* typography
================== */
h1 {
font-weight: 300;
font-size: 1.7rem;
margin-top: 0;
}
p {
margin-top: 0;
line-height: 1.5;
}
p:last-of-type {
margin-bottom: 0;
}
.title {
font-size: 2.5em;
margin-top: 1em;
margin-bottom: 1.5em;
font-weight: 900;
}
.title span {
font-weight: 300;
display: block;
font-size: .9em;
}
#media(min-width:60rem) {
p {
font-size: 1.2rem;
line-height: 1.6;
}
.title {
font-size: 3.7em;
margin-bottom: 1em;
margin-top: 0;
font-weight: 900;
}
}
/* buttons */
.button {
display: inline-block;
font-size: 1.15em;
text-decoration: none;
text-transform: uppercase;
border-width: 2px;
border-style: solid;
padding: .5em 1.75em;
color: #00ff6c;
border-color: #00ff6c;
}
#media (min-width: 60rem) {
.button {
font-size: 1.5rem;
}
.button-small {
font-size: .7rem;
font-weight: 700;
}
.button-accent {
color: #00ff6c;
border-color: #00ff6c;
}
.button-accent:hover,
.button-accent:focus {
background: #00ff6c;
color: #232323;
}
}
/* header
================== */
header {
position: absolute;
margin-top: 1em;
left: 0;
right: 0;
margin: 1em;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
margin: 1em;
}
nav a {
font-weight: 900;
text-decoration: none;
padding: .5em;
text-transform: uppercase;
color: #FFF;
font-size: .8rem;
}
nav a: hover,
nav a: focus {
color: #DDD;
}
#media(min-width:60rem) {
.logo {
float: left;
}
nav {
float: right;
}
}
/* home-hero
================== */
.home-hero {
background-image: url(https://i.postimg.cc/XY54RwQY/hero-bg.jpg);
background-size: cover;
background-position: center;
padding: 10em 0;
color: #FFF;
}
#media (min-width: 60rem) {
.home-hero {
height: 100vh;
padding-top: 35vh;
}
}
/* hero-home
======================== */
.home-about-textbox {
background-color: #232323;
padding: 4em;
margin: 0 -2.5vw;
outline: 2px solid #00ff6c;
outline-offset: -2.5em;
color: #FFF;
position: relative;
}
.home-about-textbox h1 {
color: #00ff6c;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: .75em;
background: #232323;
padding: 0 .145em;
white-space: nowrap;
}
.container {
width: 95%;
max-width: 70em;
margin: 0 auto;
background-color: mediumvioletred;
color: magenta;
}
#media (min-width: 25rem) {
h1 {
font-size: 2 rem;
}
.home-about-textbox h1 {
top: .6em;
padding: 0 .325em;
}
}
#media (min-width: 60rem) {
h1 {
font-size: 2.5rem;
}
.home-about {
background-image: url();
background-repeat: no-repeat;
padding-bottom: 10em;
}
.home-about-textbox {
width: 50%;
padding: 7em;
outline-offset: -3.75em;
margin-left: -2.5%;
top: -5em;
text-align: left;
box-shadow: 0 0 4em 0 rgba(0, 0, 0, .3);
}
.home-about-textbox h1 {
top: .75em;
left: 6rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: .75em;
background: #232323;
padding: 0 .145em;
}
}
.container {
width: 95%;
max-width: 70em;
margin: 0 auto;
background-color: coral;
font-weight: 100;
color: blue;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Creative Inc.</title>
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<body>
<header>
<img src="https://i.postimg.cc/NFtwcdYg/logo.png" alt="Creative inc. logo" class="logo">
<nav>
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</header>
<section class="home-hero">
<div class="container">
<h1 class="title">Making things looks great
<span>for companies who make great stuff</span>
</h1>
See Our Work
</div>
</section>
<div class="container">
<section class="home-about">
<div class="home-about-textbox">
<h1>Who we are</h1>
<p>Sit by the fire drink water out of the faucet hide head under banket so no one can see cat is love, cat is life.Knock dish off table eating always hungry so favor packaging over toy.</p>
<p>
<srong>Rub face on owner.</srong>Peer out window, chatter at birds, lure then to mouth. Chase ball of string eat a plant, kill a hand, i am the best have secret plans.
</p>
</div>
</section>
</div>
</body>
</html>
Here, the home-about-textbox is defined in three different ways with the class attribute :
`<div class="container">
<section class="home-about"> for pc media
<div class="home-about-textbox">`for mobile media
But the container also selects the "home-hero" section: <section class="home-hero"> <div class="container">.
I tried to figure out what is the role of the container. When I select the .container in the css style sheet just the "home-about-textbox" becomes blue on the browser so I tried to change color of the container to see if this class truly selects both of the sections( "home-hero" & "home-about-textbox") how it seems to be.
I selected the container again at the end of the code to make sure that nothing else overrides it (the last media declaration is closed) and I styled with crazy colors but nothing change. I even tried !important rule and the style is the same. My question is:
What exactly this container class selects in the code and why I can't style it?
container is a class that is given to a div tag to define your web page size, and all of the other elements should be inside of it so they will have all styles given to their parent ( container)
you use the !important wrong, you should use it this way:
background-color: red !important;
I'm very new at CSS so please be patient with me. I am trying to set a video background for a section with a semi transparent text box over the video. After wrestling with it for a while, I finally got the video fitted to the screen and resizing when the screen shrinks.
The problem is, now the section containing the text doesn't resize when the screen becomes narrower. Instead, the text disappears under the next div down.
I presumed this is because the aspect ratio of the video can't be modified. The best solution I could come up with is to set a media query to replace the video with a static background when the screen is under 700 pixels wide. I was hoping that the normal properties of auto;" would then kick in and accommodate the additional length of the text. However, the video doesn't respond to the "display: none;" tag when placed in a media query.
I'm kind of stuck as to what to do.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, `enter code
here`initial-scale=1.0">
<title>Jamaa</title>
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<ul class="navbar">
<li><p href="#home" style="margin-left: 20px;">JAMAA</p></li>
<li style="float:right">Contact</li>
<li style="float:right">News</li>
<li style="float:right"><a class="left" href="#about">Blog</a></li>
</ul>
<section class="intro">
<div class="content">
<img src="images/jamaalogo.png"
style="height:300px; margin-top: 5%; align-content: center; "
class="center">
<h1 class="motto">Share. Profit.</h1>
<h2 style="text-align: center;">Using finance to increase cryptocurrency
access for those who need it most.</h2>
</div>
</section>
<div class="video_wrapper">
<video preload="auto" autoplay="true" loop="loop" muted="muted"
volume="0" poster="images/relief.jpg" style="height:auto; ">
<source src="images/fountain.mp4" type="video/mp4">
<div class="problem_box"><h2>We Have a Problem</h2><p>People are
losing their savings. Governments are collapsing. The threat of war is
looming on the horizon. All of these problems have a common source- bad
money. And yet most of us don't know what we can do about it.</p></div>
</video>
Here is the CSS:
#font-face {
font-family: 'textabold';
src: url('fonts/texta-bold-webfont.woff2') format('woff2'),
url('fonts/texta-bold-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono"
rel="stylesheet">
* {
box-sizing: border-box;
}
body {
margin: 0;
font-weight: 500;
font-family: 'Roboto Mono', monospace;
overflow-x: hidden;
}
h2 {
font-size: 2em;
display: block;
color: white;
font-weight: 300;
}
h1 {
font-size: 3em;
display: block;
color: white;
font-weight: 300;
}
p {
font-size: 1 em;
font-weight: 500;
color: white;
}
a {
font-weight: 700;
color: #333;
&:hover{
opacity: 0.8;
}
&:active {
top: 1px;
}
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.container {
display: flex;
color: white;
justify-content: space-between;
align-items: center;
padding: 2px 44px;
}
.navbar {
position: fix
}
#media screen and (max-width : 760px){
ul {
display: none;
}
.intro { background: red;}
.video_wrapper {
height:auto;
background: url("images/relief.jpg") no-repeat center center;
background-size: cover;
}
.video {
display: none;
}
}
.title {
display: block;
color: white;
align-items: center;
padding: 12px 44px;
font-size:;
}
li a:hover {
background-color: #4CAF50;
}
.intro {
height: 92vh;
background-color: #4CAF50;
display: block;
overflow: hidden;
}
.problem {
max-height: 60vh;
background-size: cover;
opacity: 0.8;
z-index: -100;
}
.problem_box {
height:70%;
z-index: 2;
}
.video_wrapper{
width: auto;
position: relative;
overflow: hidden;
z-index: -1;
margin-bottom: -30px;
text-align: center;
}
.video_wrapper video{
position: relative;
top: 0;
left: 0;
width: 100%;
height: auto;
z-index: 1;
height: auto;
overflow: auto;
}
.video_wrapper .problem_box {
height: auto;
width: 70%;
position: absolute;
z-index: 2;
top: 0px;
left: 0px;
background: #333;
opacity: 0.9;
display: inline-block;
margin-top: 8%;
margin-left: 15%;
box-sizing: content-box;
}
I suppose I could just give up and use static background, but it took me so long to figure out the video background I'd hate to throw it away it this point... any help is much appreciated!
you forgot to put the video class on the video tag
<video preload="auto" autoplay="true" loop="loop" muted="muted"
volume="0" poster="images/relief.jpg" style="height:auto; " class="video">
Flexbox isn't working in Chrome or Safari but works fine in Firefox. The vertical images are expanding to not fit within their container, but in Firefox they're behaving as I want them to. Here is the code, any idea? Thanks.
body{ max-width: 1970px;
margin: 0 auto;
padding: 0 2%;
box-sizing: border-box;
padding-top: 100px;
}
a {
text-decoration: none;
font-family: 'Karla', sans-serif;
font-size: 1em;
letter-spacing: -0.03em;
}
img {
max-width: 100%;
}
/***********************************
HEADING
************************************/
header {
float: left;
position:fixed;
top:0;
width: 100%;
z-index: 99;
background-color: white;
}
h1 {
font-family: 'Giorgio Sans Web', sans-serif;
margin: 0 auto;
font-size:4.5em;
font-weight: 700;
font-style: normal;
font-stretch: normal;
}
h2 {
font-family: 'Giorgio Sans Web', sans-serif;
margin: 0 auto;
font-size:4em;
font-weight: 700;
font-style: normal;
font-stretch: normal;
line-height: 3em;
}
h3 {
font-family: 'Karla', sans-serif;
font-weight: 400;
font-size:1.3em;
margin: 0 0 1em 0;
}
h4 {
font-family: 'Giorgio Sans Web', sans-serif;
margin: 0 auto;
font-size:2.5em;
font-weight: 700;
letter-spacing:0.0625em;
font-style: normal;
font-stretch: normal;
}
h5 {
font-family: 'Karla', sans-serif;
font-weight: 700;
font-size: 0.75em;
line-height: 1.2em;
}
p {
font-family: 'Karla', sans-serif;
line-height: 1.5em;
font-size: 1.2em;
letter-spacing: -0.03em;
}
/***********************************
NAVIGATION
************************************/
nav {
/*text-align: center;
margin: 0 2%;
box-sizing: border-box;*/
background-color: white;
}
#nav-parent {
height:;
display:flex;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
padding: 10px 3%;
margin: 0 auto;
}
.nav-icon {
flex-basis:auto;
}
#logo {
flex-basis:auto;
box-sizing: border-box;
padding-left: 20px;
}
.contact-button {
flex-basis:auto;
}
nav li a {
padding:0;
}
/***********************************
SIDE NAV
************************************/
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 100;
top: 0;
left: 0;
background-color: #F3F3F3;
overflow-x: hidden;
transition: 0.5s;
padding-top: 20px;
}
#sidenav-content {
margin-left: 13px;
}
.sidenav a {
text-decoration: none;
color: #000;
display: block;
transition: 0.3s;
}
.sidenav a h4 {
overflow: hidden;
white-space: nowrap;
padding: 16px 8px 0px 6px;
color: #000;
display: block;
transition: 0.1s;
}
.sidenav p {
padding: 0px 8px 8px 26px;
font-size: 16px;
color: #000;
display: block;
transition: 0.3s;
width: 250px;
}
.slide-nav-link {
margin-top: 10px;
padding: 8px 8px 8px 26px;
line-height: 2.2em;
}
.slide-nav-social {
width: 150px;
height:50px;
margin-top: 20px;
margin-left: 26px;
}
.slide-nav-social a {
width:20px;
padding: 0 15px 0 0;
display: inline-block;
}
.sidenav a:hover, .offcanvas a:focus{
color: #6B00FF;
}
.sidenav .closebtn {
padding: 15px 8px 8px 26px;
font-size: 30px;
margin-left: 0px;
}
.closebtn a:hover {
color: #000;
}
#media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
/***********************************
FOOTER
************************************/
footer {
font-size: 0.75em;
text-align: center;
clear: both;
padding-top: 50px;
color: #ccc;
}
.social-icon {
width:20px;
height: 20px;
margin: 0 5px;
}
/***********************************
PAGE: PORTFOLIO
************************************/
.gallery{
margin: 0 auto;
list-style: none;
padding-left: 0;
}
.gallery figure {
overflow: hidden;
float: left;
width: 48%;
margin: 1%;
z-index: 97;
position: relative;
float: left;
}
.gallery figcaption {
background: rgba(255,255,255,0.97);
display : flex;
align-items : center;
text-align: center;
color: white;
float: left;
position: absolute;
left: 0;
opacity: 0;
right: 0;
top: 0;
height:100%;
z-index: 98;
-webkit-transition: all 300ms;
-moz-transition: all 300ms;
transition: all 300ms;
-webkit-transition-delay: 100ms;
-moz-transition-delay: 100ms;
transition-delay: 100ms;
}
.gallery figcaption h3 {
width:100%;
text-align: center;
color:#000;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
.gallery li:hover figcaption {
opacity: 1;
}
/***********************************
PAGE: Project
************************************/
.project-gallery{
margin: 0 auto;
padding: 0 1.5%;
list-style: none;
}
.project-gallery img{
max-width: 100%;
margin: 1.5% 0;
}
.project-gallery hr {
margin: 40px 0;
border: none;
height: 3px;
background-color: #000;
}
.project-title {
max-width: 100%;
text-align: center;
padding-top: 40px;
}
.description-text {
display:inline;
}
.left-column-text {
width:30%;
margin-left: 5%;
margin-top: 8px;
display:inline-block;
vertical-align: top;
}
.left-column-text p {
margin: 10px 0 25px 0;
}
.left-column-text h5 {
margin-bottom: -5px;
}
.right-column-text {
width:50%;
margin: 0 5% 0 8%;
display:inline-block;
vertical-align: top;
}
.vertical-imgs {
display: -webkit-flex; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-flex; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display:flex;
justify-content: space-between;
margin: 1% 0;
}
.vertical-img-left {
box-sizing: border-box;
padding-right: 3%;
}
.vertical-img-right {
box-sizing: border-box;
}
.prev-next-buttons {
margin-right: -3.7%;
}
.prev-next-buttons a {
display: inline-block;
margin: 0;
box-sizing: border-box;
padding: 20px 5%;
}
.prev-button {
width:48%;
}
.next-button {
text-align: right;
width:48%;
}
/***********************************
PAGE: About
************************************/
.profile-photo {
display: block;
max-width: 150px;
margin: 0 auto 30px;
border-radius: 100%;
}
/***********************************
PAGE: CONTACT
************************************/
.contact-info {
list-style: none;
padding: 0;
margin: 0;
font-size: 0.9em;
}
.contact-info a {
display: block;
min-height: 20px;
background-repeat: no-repeat;
background-size: 20px 20px;
padding: 0 0 0 30px;
margin: 0 0 10px;
}
.contact-info li.mail a {
background-image: url('../img/mail.png')
}
.contact-info li.twitter a {
background-image: url('../img/twitter.png')
}
.contact-info li.phone a {
background-image: url('../img/phone.png')
}
/***********************************
COLORS
************************************/
/* site body */
body {
background-color: #fff;
color:#000;
}
/*green header
header {
background: #6ab47b;
border-color: #599a68;
}*/
/*nav background on mobile
nav {
background: #599a68;
}*/
/*logo text */
h1 {
color: #000;
}
/*link color*/
a {
color:#000
}
/*nav link colors*/
nav a, nav a:visited {
color: #000;
}
/* selected nav link colors*/
nav a.selected, nav a:hover {
color: #5513FE
}
/* selected prev next link colors*/
a h1.selected, a h1:hover {
color: #5513FE
}
a h4.selected, a h4:hover {
color: #5513FE
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cari Sekendur - MHG Modern Classic</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" type="text/css" href="fonts/1606-HQIULX.css">
<link href="https://fonts.googleapis.com/css?family=Karla:400,400i,700,700i" rel="stylesheet">
<link rel="stylesheet" href="css/main1.css">
<link rel="stylesheet" href="css/responsive.css">
<meta name="viewport" content= "width=device-width, initial-scale=1.0">
</head>
<body>
<header>
<nav>
<ul id="nav-parent">
<li class="nav-icon">
<span style="cursor:pointer" onclick="openNav()"
</span>
<img src="img/nav-icon.svg" class="nav-icon">
</li>
<li id="nav-icon">
<a href="index.html" id="logo">
<h1>CARI</h1>
</a>
</li>
<li class="nav-icon">
Contact
</li>
</ul>
</nav>
</header>
<div id="mySidenav" class="sidenav">
<div id="sidenav-content">
<img src="img/nav-icon-open.svg" class="nav-icon">
<div class= "slide-nav-link">
Work
About
Contact
</div>
<div class= "slide-nav-text">
<a href="index.html" id="logo">
<h4>CARI SEKENDUR</h4>
</a>
<p>Creating visual experiences that make the complex clear and the average exceptional.</p>
</div>
<div class= "slide-nav-social">
<img src="img/WNWlogo.svg">
<img src="img/linkedin-black.svg">
<img src="img/pinterest-black.svg">
</div>
</div>
</div>
<!--Click on the element below to open the side navigation menu.-->
<script>
function openNav() {
document.getElementById("mySidenav").style.width = "350px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
</script>
<div class="wrapper">
<section class="project-gallery">
<div class="horiztonal-img">
<img src="img/mhg-zine/CARI_MHG_ZINE_1.gif" alt="">
</div>
<div class="project-title">
<h2>MORGANS HOTEL GROUP - MODERN CLASSIC ZINE</h2>
</div>
<hr>
<div class="description-text">
<div class="left-column-text">
<h5>STUDIO</h5>
<p>LMNOP Creative</p>
<h5>CREATIVE DIRECTION</h5>
<p>Leigh Nelson</p>
<h5>DESIGN</h5>
<p>Cari Sekendur, Leigh Nelson, Heidi Chisholm</p>
</div>
<div class="right-column-text">
<p> Morgans Hotel Group launched the global phenomenon of boutique hotels 20 years ago, and to celebrate their rich history they put together a campaign called The Modern Classic. Each of Morgans' properties has a design aesthetic that is unlike anything you've seen before, awe-inspiring and always over-the-top. So, to capture the essence of Morgans' brand, we concepted, designed, and printed a zine for them to distribute to hotel guests. This project was a print designer's dream, complete with gold-holographic foil, gold staples, fluorescent Pantone inks, collage, illustration, a tear-out poster, and even a little pack of temporary tattoos.
</p>
</div>
<hr>
</div>
<div class="horiztonal-img">
<img src="img/mhg-zine/CARI_MHG_ZINE_2.jpg" alt="">
</div>
<div class="vertical-imgs">
<img src="img/mhg-zine/CARI_MHG_ZINE_8.jpg" alt="" class="vertical-img-left">
<img src="img/mhg-zine/CARI_MHG_ZINE_5.jpg" alt="" class="vertical-img-right">
</div>
<div class="horiztonal-img">
<img src="img/mhg-zine/CARI_MHG_ZINE_7.jpg" alt="">
</div>
<div class="prev-next-buttons">
<a href="#" class="prev-button">
<h2>PREVIOUS</h2>
</a>
<a href="#" class="next-button">
<h2>NEXT</h2>
</a>
</div>
<hr class="bottom-hr" style="margin-top: 0px;">
</section>
<footer>
<p></p>
</footer>
</div>
</body>
</html>
use :
#nav-parent {
display:flex;
display: -webkit-flex;
-webkit-flex-flow: initial;
flex-flow: initial;
justify-content: space-between;
align-items: center;
padding: 10px 3%;
margin: 0 auto;
}
Basically I'm trying to write some responsive code but I can't get it to work. What am I doing wrong?
Here's the page code with the extraneous bits removed:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Zinuru Project | Tighe O'Connor</title>
<!-- Site Stylesheet(s) -->
<link rel="stylesheet" type="text/css" href="scripts/zinuru.css" >
<link rel="stylesheet" type="text/css" href="scripts/zinuru-media-queries.css">
<!-- JQuery Stylesheet(s) -->
<link href="scripts/lightbox.css" rel="stylesheet" type="text/css">
</head>
<body id="<%=(rsMainMenu.Fields.Item("menuClass").Value)%>">
<div id="pageWrapper">
<aside>
<!--#include file="includes/aside.asp" -->
</aside>
<article>
<header>
<!--#include file="includes/header.asp" -->
</header>
<nav>
<!--#include file="includes/navbar.asp" -->
</nav>
<figure class="banner_slider">
<%
While ((rpt_Images__numRows <> 0) AND (NOT rsImages.EOF))
%>
<img src="images/<%=(rsImages.Fields.Item("imageName").Value)%>" class="nailthumb-container">
<%
rpt_Images__index=rpt_Images__index+1
rpt_Images__numRows=rpt_Images__numRows-1
rsImages.MoveNext()
Wend
%>
</figure>
<div id="content"><%=(rsContent.Fields.Item("content").Value)%></div>
</article>
</div>
<!-- /#pageWrapper -->
<!-- JQuery Runtime -->
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<!-- JQuery Plugins -->
<script src="scripts/jquery.nailthumb.1.1.js" type="text/javascript"></script>
<script src="scripts/lightbox-2.6.min.js" type="text/javascript"></script>
<script src="scripts/cycle.js" type="text/javascript"></script>
<!-- Local Scripts -->
<script type="text/javascript" src="scripts/localscripts.js"></script>
</body>
</html>
Here's the main site stylesheet:
/* CSS crunched with Crunch - http://crunchapp.net/ */
#import "/scripts/html5reset-1.6.1.css";
#import "/scripts/muli.css";
#import "/scripts/painted.css";
/**************************************************************************************
GENERAL STYLING
**************************************************************************************/
body {
background-color: #161616;
font-family: 'MuliRegular';
color: #616163;
font-size: 1em;
}
#pageWrapper {
position: relative;
top: 35px;
width: 836px;
margin: auto;
}
a {
outline: 0;
outline: none;
}
#home .home,
#artist .artist,
#installations .installations,
#paintings .paintings,
#reviews .reviews,
#teaching .teaching {
color: #ffffff;
}
/**************************************************************************************
HEADER
**************************************************************************************/
header {
height: 35px;
}
header #logo {
text-align: right;
}
header #logo #zinuru {
display: none;
}
header #logo #tighe {
font-family: 'MuliLight';
font-variant: small-caps;
font-size: 1.6em;
color: #ffffff;
}
/**************************************************************************************
NAVIGATION BAR
**************************************************************************************/
nav {
width: 706px;
height: 40px;
text-align: center;
}
nav dl {
padding: 0;
margin: 0;
display: inline-block;
position: relative;
text-align: left;
}
nav dl a {
display: block;
white-space: nowrap;
text-decoration: none;
color: #616163;
}
nav dl {
*display: inline;
}
nav dt {
height: 35px;
line-height: 35px;
}
nav dt a:hover {
color: #ffffff;
}
nav dd {
position: absolute;
left: 0;
margin: 0;
display: none;
background: #161616;
box-shadow: 1px 1px 2px #949494;
min-width: 190px;
padding: 0 3px;
z-index: 1000;
}
nav dd a {
color: #949494;
line-height: 25px;
}
nav dl.right dd {
text-align: right;
left: auto;
right: 0;
}
nav dl:hover dd {
display: block;
}
nav dl dd a:hover {
color: #ffffff;
}
nav .menuDivider {
margin: 0 5px;
color: #FFF;
}
/**************************************************************************************
ASIDE
**************************************************************************************/
aside {
width: 130px;
float: left;
}
aside #zinuru {
position: fixed;
margin: 240px 0 0 -195px;
width: 500px;
-moz-transform: rotate(270deg);
-webkit-transform: rotate(270deg);
-o-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
font-family: 'painted';
font-size: 5.5em;
color: #ffffff;
}
/**************************************************************************************
ARTICLE
**************************************************************************************/
article {
margin-left: 130px;
width: 706px;
/**************************************************************************************
PAINTINGS
**************************************************************************************/
}
article p {
margin-bottom: 10px;
line-height: 120%;
text-align: justify;
}
article h1 {
font-family: 'painted';
font-size: xx-large;
color: #ffffff;
margin: 20px 0 10px;
}
article figure {
border: #FFF thin solid;
}
article #content {
margin-top: 15px;
}
article table.paintings {
width: 706px;
}
article table.paintings tr {
text-align: center;
}
article table.paintings td {
padding-bottom: 6px;
}
article .paintingsThumbs {
width: 140px;
height: 140px;
}
/**************************************************************************************
THUMBNAIL CONTAINER
**************************************************************************************/
.nailthumb-container {
width: 706px;
height: 211.8px;
}
and this is my starting point media query stylesheet:
/* CSS crunched with Crunch - http://crunchapp.net/ */
/**************************************************************************************
SCREEN 320px
**************************************************************************************/
#media only screen and (max-device-width: 320px) {
#pageWrapper {
top: 0;
width: 300px;
margin: auto;
}
header {
height: 60px;
}
header #logo #zinuru {
display: block;
line-height: 5px;
}
header #logo #tighe {
font-size: 1em;
}
nav {
display: none;
}
aside {
display: none;
}
}
Hope you can see where I've gone wrong and what I need to change.
Many thanks in advance.
change:
#media only screen and (max-device-width: 480px) { ... }
to:
#media only screen and (max-width: 480px) { ... }
that way your site will respond on a mobile device and on the desktop.
By using max-device-width those rules will only kick in if the physical device's screen width is less than X px not if you adjust your browser size. I changed the number to 480px because that's the standard width of an iphone screen. 320px is too small.
Also use:
<meta name="viewport" content="width=device-width, initial-scale=1">
the initial-scale set's the virtual scale created by mobile devices to 100%, so that your site is viewed properly.