display:none not correctly working on mobile - html

there ho here's a CSS code, I want to hide it on PC view but visible on Phone view, I'm able to achieve my results on PC, but not on Phone, because display: none; is interfering with the code's work. Can anyone please check it?
/* --------- Game-section-mobile---------*/
* {
transition: all .155s ease-in-out;
}
.event-link {
margin: 300px 0 0 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
text-decoration: none;
}
.event-h3 {
margin-top: 30px;
}
.events {
display: flex;
flex-wrap: wrap;
display: none;
}
.events .shadowbox {
height: 100vh;
padding-top: 0;
background: rgba(0, 0, 0, 0.5);
}
.event {
text-align: center;
margin-top: 0;
min-width: 100px;
background-repeat: no-repeat;
}
.event .event-h3 {
padding-top: 50px;
}
.event {
background-size: cover;
background-position: center;
height: 100vh;
flex-grow: 1;
flex-basis: 0;
text-align: center;
min-width: 100px;
background-repeat: no-repeat;
}
.event:hover {
flex-grow: 2;
}
.events .shadowbox:hover {
background: rgba(0, 0, 0, 0.76);
}
.event .event-h3,
.event p {
color: white;
width: 90%;
margin: auto;
}
.event:not(:first-of-type) {
border-left: 1px solid white;
}
.shadowbox img{
margin-top: 50%;
height: 200px;
}
#media only screen and (max-width: 775px) {
.event:last-of-type {
margin-bottom: 10px;
}
.event:hover {
flex-grow: 1;
}
.event:nth-of-type(1) {
max-width: 100%;
}
.event {
min-width: 300px;
margin-bottom: 3px;
}
.shadowbox img{
margin-top: 50%;
height: 150px;
}
}
#media only screen and (max-width: 775px){
.events{
display: block;
}
}

You have a second media query for .events. So when your screen width is smaller than 775px, your .events will get displayed again. Which is the case on a mobile view. Delete or comment it out, and it should work.
#media only screen and (max-width: 775px){
.events{
display: block;
}
}

Related

Image does not scale

First, I want to state that I am not a web designer, but I am trying to search for solutions.
At the moment I am at loss, as I cannot figure out why a logo I am trying to add on a footer does not scale with resolution.
In fact, it is displaying it in full resulation only.
There is another logo in the footer that is scaling when resolution changes.
When I paste the code in TryIt, it is working, but once I put it on server, the image is in full resolution always.
Here is the TryIt link - https://www.w3schools.com/code/tryit.asp?filename=GRDOYEDNJX5K
As tyou can see, here the code would work.
What I have done is defined the image in footer.php
<div class="logo5">
<img src='https://i.ibb.co/42Lgdw7/8a2403c4b0d344d5ae7c3762c74fddb4-0001.jpg' class="logo5">
</div>
And added to CSS these lines
.logo5 {
width: 100%;
height: auto;
}
This is the rest of _footer.scss file
.footer-wrapp {
background-image: url("../../images/footer_back.jpg");
background-position: top;
background-size: cover;
background-repeat: no-repeat;
.container {
width: 100% !important;
max-width: unset !important;
}
.additional-info {
padding: 30px 0;
#media screen and (max-width: 992px) {
padding: 30px 0 15px;
}
h4 {
color: #fff;
}
p {
color: #7d7d7d;
}
}
#myFootNavWrapp {
margin: 60px 15% 0;
#media screen and (max-width: 1600px){
margin: 60px 5% 0;
}
#media screen and (max-width: 992px) {
margin: 0;
padding-left: 0;
padding-right: 0;
justify-content: space-between;
}
#media screen and (max-width: 520px) {
align-items: flex-start;
padding-top: 25px;
}
a {
color: #6377a4;
margin-right: 20px;
&:hover {
text-decoration: none;
border-bottom: 2px solid $main__red;
}
}
.mobile-logo-wrapp {
display: none;
margin-left: 20px;
#media screen and (max-width: 992px) {
display: inline-block;
}
a {
display: inline-block;
width: 45px;
height: 45px;
background-image: url("../../images/logo.jpg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
}
#navFoot {
border-radius: 10px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
#media screen and (max-width: 992px) {
display: flex;
justify-content: center;
align-items: center;
}
.customFootNav {
flex-grow: 1;
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
list-style-type: none;
flex-wrap: wrap;
width: 100%;
#media screen and (max-width: 520px) {
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
}
li {
flex-grow: 1;
min-width: 5%;
a {
color: $main__dark_blue;
border-bottom: 2px solid transparent;
transition: all 0.2s linear;
font-weight: 600;
}
&:hover {
a {
text-decoration: none;
border-bottom: 2px solid $main__red;
}
}
}
}
.privacyFootNav {
flex-grow: 1;
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
list-style-type: none;
flex-wrap: wrap;
width: 100%;
#media screen and (max-width: 520px) {
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
}
#media screen and (min-width: 520px) and (max-width: 788px) {
margin-left: 92px;
}
li {
flex-grow: 1;
min-width: 5%;
a {
color: #6377a4;
border-bottom: 2px solid transparent;
transition: all 0.2s linear;
font-weight: 400;
}
&:hover {
a {
text-decoration: none;
border-bottom: 2px solid $main__red;
}
}
&.current-menu-item {
a {
text-decoration: none;
border-bottom: 2px solid $main__red;
}
}
}
}
.additional-wrapp {
flex-grow: 1;
}
.custom-menu-logo {
position: relative;
height: 95px;
min-width: 200px;
#media screen and (max-width: 1500px) {
min-width: 175px;
}
#media screen and (max-width: 1200px) {
min-width: 150px;
}
#media screen and (max-width: 992px) {
min-width: unset;
width:90px;
margin-right: 20px;
}
#media screen and (max-width: 520px){
display: none;
}
&:before {
content: '';
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
margin: 0 auto;
background-image: url("../../images/Logo_Red.jpeg");
background-position: center;
background-size: contain;
background-repeat: no-repeat;
transition: all 0.2s linear;
}
a{
outline: none;
display: block;
z-index: 9999;
position: absolute;
width: 100%;
height: 100%;
}
&:hover {
border: none;
a {
border: none;
}
}
}
}
}
}
Is there anything that would interfere with the logo I am trying to add to not scale?
Thank you.
I noticed that you're using wordpress, I already had problems while customizing themes and files this way, because wordpress theme sometimes overwrite your style and that's is bad.
To avoid it, I needed to put the css !important property, this way you force your style over any other that not have this property.
Maybe it's not the best appraoch, but worked for me, you should give a try.
.logo5 {
width: 100% !important;
height: auto !important;
}

Display: flex from display: none in breakpoint not working in safari on OSX

Given the following HTML and CSS, the myLinks div is hidden on screens below 1025px and displays as a flexbox on screens above 1025px. The div remains hidden in Safari.
#myLinks {
display: none;
}
.menu-link {
padding-top: 0.5em;
}
#media only screen and (min-width: 1025px) {
#myLinks {
background-color: transparent;
display: -webkit-flex;
display: flex;
flex-direction: column;
position: fixed;
width: 300px;
top: 10%;
right: 0;
height: 85vh;
max-height: 85%;
border-radius: 10px;
}
}
<div id="myLinks" class="menu-link"></div>
What's really strange is I just noticed the elements are on the page, but aren't being rendered. I'm able to click on them, but I can't see them. Changing z-index to 999 doesn't resolve the issue
Edit: here's a fully built example, I don't think any of the children are causing #myLinks to be hidden because a .menu-card element removed from #myLinks is displayed and works normally, but maybe something in here doesn't play well with something in myLinks...
Run in full page
#myLinks {
display: none;
}
.menu-link {
padding-top: 0.5em;
}
.menu-card {
display: block;
text-align: center;
padding-bottom: 0;
margin-left: 5%;
margin-right: 5%;
margin-bottom: 4%;
}
.card-text {
text-align: center;
font-size: 0.75em;
padding: 0;
margin: 0;
line-height: 1;
}
/*Style navigation menu images*/
.menu-icon {
display: block;
max-width: 15%;
vertical-align: middle;
margin: auto;
}
/* Style navigation menu links */
#myLinks a {
display: block;
color: white;
font-size: 1.4rem;
text-shadow: 2px 2px black;
text-decoration: none;
text-align: center;
margin-top: 0;
padding: 14px 16px;
padding-top: 0;
}
#media only screen and (min-width: 1025px) {
#myLinks {
background-color: transparent;
display: -webkit-flex;
display: flex;
flex-direction: column;
position: fixed;
width: 300px;
top: 10%;
right: 0;
height: 85vh;
max-height: 85%;
border-radius: 10px;
}
.menu-card a {
position: relative;
width: 100%;
}
.menu-icon {
position: absolute;
z-index: 1;
right: 20%;
max-height: 55%;
border-radius: 50%;
background-color: rgb(148, 181, 201);
background-color: rgba(148, 181, 201, 0.9);
transition: all 0.8s;
max-width: 100%;
}
.card-text {
display: -webkit-flex;
display: flex;
align-items: center;
width: 0;
top: 6%;
height: 100%;
max-height: 0;
text-align: left;
font-size: 125%;
opacity: 0;
color: #5DCA31;
background-color: transparent;
text-shadow: 2px 2px black;
margin: 0;
border-color: rgb(148, 181, 201);
border-color: rgba(148, 181, 201, 0.9);
border-style: solid;
border-radius: 90px;
transition: all 0.8s;
padding-right: 0;
}
.menu-card:hover {
background-color: transparent;
opacity: 1;
transition: all 0.8s;
}
.menu-card:hover .menu-icon {
right: 5%;
}
.menu-card:hover .card-text {
opacity: 1;
padding-left: 10%;
max-height: 65%;
width: 100%;
border-width: 8px;
box-sizing: border-box;
background-color: rgb(148, 181, 201);
background-color: rgba(148, 181, 201, 0.9);
padding-right: 100px;
padding-top: 10px;
padding-bottom: 10px;
transition: background-color 0.8s, border-width 0.8s, max-width 0.8s;
}
}
<div id="myLinks" class="menu-link">
<div class="menu-card">
<a href="#">
<img class="menu-icon" src="https://nuclearterrortoday.org/img/home.jpg">
<p class="card-text" id="home">Home</p>
</a>
</div>
</div>
Try using
#media screen and (min-width: 1025px) {
#myLinks {
/* all the styles */
}
}
Or just
#media (min-width: 1025px) {
#myLinks {
/* all the styles */
}
}
The keyword ‘only’ hides style sheets from older user agents.
Hope this helps!

Media Viewport Samsung S8 CSS

I am trying to fix a CSS created by someone else(I took over a job from a other company for my current client)
As for now everything working in my website except on my Samsung Galaxy S8. The footer doesnt follow the rules. I have putted everything I could find online with
#media only screen and (min-width: 360px) and (max-width: 767px) {
/* Your Styles... */
}
But still when I'm going on the website on my S8. The text in a specific part that I want to follow rules..doesnt. (Part is Footer-right2)
On iPad, Desktop its working except this.
Any ideas ?
Here my CSS :
#media and (min-width: 360px) and (max-width: 767px) {
#footer .footer-wrapper .footer-right2 {
text-align: center;
font-size: 0.5em;
font-weight: 300;
padding-left: 15px;
margin:auto;
max-width:200px;
}
#footer .footer-logo {
display: inline-block;
padding-left: 15px;
margin:auto; } }
It's working for other size so here one of them as exemple :
#media (max-width: 768px) {
#header .header-wrapper {
height: 85px; }
#header .header-toggle-menu {
position: fixed;
top: 30px;
right: 15px;
z-index: 7000;
display: block; }
#header .header-toggle-menu span {
display: block;
width: 42px;
height: 7px;
border-radius: 3px;
background-color: #1d1d1d;
transition: background-color 0.175s linear; }
#header .header-toggle-menu span + span {
margin-top: 4px; }
#header .header-menu {
position: fixed;
right: 0;
top: 0;
bottom: 0;
z-index: 6000;
padding: 7px;
width: 300px;
background-color: #08ab0f;
padding-top: 85px;
transform: translateX(300px);
transition: transform 0.225s ease-in-out; }
#header .header-menu a {
display: block;
padding: 7px;
font-size: 0.85em;
font-weight: 900;
color: #ffffff;
transition: none;
background-color: #e13649;
margin-bottom: 7px; }
#header .header-menu a:hover, #header .header-menu a:focus {
color: #ffffff; }
#header.active .header-menu {
transform: translateX(0); }
#header.active .header-toggle-menu span {
background-color: #ffffff; }
#footer .footer-wrapper .form-message {
top: 85px; }
#footer .footer-wrapper .footer-right2 {
text-align: center;
font-size: 0.5em;
font-weight: 300;
padding-left: 15px;
margin:auto;
max-width:200px;
}
#footer .footer-logo {
display: inline-block;
padding-left: 15px;
margin:auto; }
#page {
padding-top: 85px; }
.slider-container {
height: 530px;
background-color: #08ab0f; }
.slider-container .slider-slides {
height: 500px; }
.slider-container .slider-slides .slides-item {
position: relative; }
.slider-container .slider-slides .slides-item .item-left, .slider-container .slider-slides .slides-item .item-right {
position: absolute;
top: 0;
left: 0;
right: auto;
width: 100%;
height: 100%; }
.slider-container .slider-slides .slides-item .item-left {
z-index: 100;
background-color: rgba(0, 0, 0, 0.3);
text-align: center; }
.slider-container .slider-slides .slides-item .item-right {
z-index: 50; }
.slider-container .slider-navigation {
position: absolute;
bottom: 0; }
.single-team_member .team-member-header {
display: block;
align-items: stretch;
justify-content: center;
flex-direction: column;
flex-wrap: nowrap; }
.single-team_member .team-member-header .header-image {
padding: 0; }
.single-team_member .team-member-header .header-image:before {
content: '';
display: block;
padding-bottom: 56.75%; }
.single-team_member .team-member-header .header-content {
background-color: #1d1d1d;
padding: 30px 15px; } }

Need to fix my footer to the bottom

I am trying to put a footer at the bottom of the page.
I am unable to make this page's footer correct.
I tried a lot tips and trick that I found but nothing helped me.
I do not want the position fixed, I want the footer under the content.
Add this too your footer style:
position: fixed;
bottom: 0;
z-index: 10;
Entire style sheet:
/*!
* Start Bootstrap - Half Slider (http://startbootstrap.com/template-overviews/half-slider)
* Copyright 2013-2017 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-half-slider/blob/master/LICENSE)
*/
html, body { height: 100%; width: 100%; margin: 0;
}
footer{display: block;color: white;width: 100%;background-color: rgb(28,28,28);text-align: center;padding: 10px;position: fixed;bottom: 0;z-index: 10;}
.cock {
}
.telicko {
height: 95.5%;
}
.sicko {
width: 100%;
height: 80%;
position: absolute;
top: 5%;
}
.snavik{
float: left;
margin-top:8vh;
}
.nav {
list-style-type: none;
text-decoration:none;
}
.jednicka a.active{
background-color: rgb(50,134,171);
color: white;
border-radius: 3px;
}
.dvojka a.active{
background-color: rgb(202,76,77);
color: white;
border-radius: 3px;
}
.trojka a.active{
background-color: rgb(219,162,10);
color: white;
border-radius: 3px;
}
.stvorka a.active{
background-color: rgb(132,177,58);
color: white;
border-radius: 3px;
}
.patka a.active{
background-color: black;
color: white;
border-radius: 3px;
}
.jednicka a {
color: black;
}
.dvojka a {
color: black;
}
.trojka a {
color: black;
}
.stvorka a {
color: black;
}
.patka a {
color: black;
}
.jednicka:hover a {
background-color: rgb(50,134,171);
color: white;
border-radius: 3px;
}
.dvojka:hover a{
background-color: rgb(202,76,77);
color: white;
border-radius: 3px;
}
.trojka:hover a{
background-color: rgb(219,162,10);
color: white;
border-radius: 3px;
}
.stvorka:hover a{
background-color: rgb(132,177,58);
color: white;
border-radius: 3px;
}
.patka:hover a{
background-color: black;
color: white;
border-radius: 3px;
}
.objb{
margin-bottom: 2%;
margin-top: 2%;
}
.sobrazky {
margin-top: 4%;
margin-bottom: 7vh;
}
.objbb {
margin-top: 2%;
margin-bottom: 1%;
}
.odpovede {
margin-top:8vh;
margin-left: 20vw;
height: 100%;
width: 70%;
}
.ulicko {
margin-left: -26px;
}
.carousel-item {
height: 50vh;
min-height: 150px;
width: 100%;
background: no-repeat center center scroll;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
margin: 0 auto;
}
#PART1{
padding: 0;
margin: 0;
width: 80%;
height: 25%;
margin: 0 auto;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
-webkit-box-align: center;
}
#PART2a{
padding: 0;
margin: 0;
width: 100%;
height: 25%;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
-webkit-box-align: center;
position: absolute;
top: 45%;
left: 25%;
transform: translate(-50%, -50%);
}
#PART2b{
padding: 0;
margin: 0;
width: 100%;
height: 25%;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
-webkit-box-align: center;
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, -50%);
}
.smenu{
position: absolute;
top: 15%;
left: 3%;
}
.snav {
list-style-type: none;
}
.nav-item a:hoover{
color: rgb(236,212,146);
}
.uo {
width: 40%;
display: block;
margin-top: 40%;
}
.medzera {
height: 5vh;
width: 100%;
}
.tretiavec {
width: 35%;
padding-left: 5%;
}
.krok1{
display: flex;
align-items: center;
justify-content: center;
font-size: 150%;
color: black;
border:2px solid rgb(216,192,126);
width: 60px;
height: 60px;
border-radius: 100%;
margin: 0 auto;
background-color: rgb(236,212,146);
}
.krok2{
display: flex;
align-items: center;
justify-content: center;
font-size: 150%;
color: black;
border:2px solid rgb(216,192,126);
width: 60px;
height: 60px;
border-radius: 100%;
margin: 0 auto;
background-color: rgb(236,212,146);
}
.krok3{
display: flex;
align-items: center;
justify-content: center;
font-size: 150%;
color: black;
border:2px solid rgb(216,192,126);
width: 60px;
height: 60px;
border-radius: 100%;
margin: 0 auto;
background-color: rgb(236,212,146);
}
.txta {
width: 20vw;
height: 15vh;
}
.formularo {
position: absolute;
top: 10%;
left:10%;
margin-top: 2%;
padding-bottom: 7%;
width: 80vw;
display: flex;
}
.idd{
text-align: center;
}
.contactformularo{
border-right: 2px solid black;
width: 33%;
padding-right: 5%;
}
.objto {
margin: 0 auto;
margin-top: 10vh;
}
.lolo {
text-align: center;
}
.containerch {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width:100%;
}
.chbox1, .chbox2, .chbox3, .chbox4, .chbox5 {
position: absolute;
opacity: 0;
}
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #eee;
border-radius: 3px;
}
#checkmark1{
border: 1px solid rgb(50,134,171);
}
#checkmark2{
border: 1px solid rgb(202,76,77);
}
#checkmark3{
border: 1px solid rgb(219,162,10);
}
#checkmark4{
border: 1px solid rgb(132,177,58);
}
#checkmark5{
border: 1px solid black;
}
.containerch:hover input ~ .checkmark {
background-color: #ccc;
}
.containerch input:checked ~ #checkmark1 {
background-color: rgb(50,134,171);
}
.containerch input:checked ~ #checkmark2 {
background-color: rgb(202,76,77);
}
.containerch input:checked ~ #checkmark3 {
background-color: rgb(219,162,10);
}
.containerch input:checked ~ #checkmark4 {
background-color: rgb(132,177,58);
}
.containerch input:checked ~ #checkmark5 {
background-color: black;
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.containerch input:checked ~ .checkmark:after {
display: block;
}
.containerch .checkmark:after {
left: 7px;
top: 3px;
width: 40%;
height: 65%;
border: solid white;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.answerhos {
}
.modind {
overflow: inherit;
}
.iu {
cursor:pointer
}
.iui {
width: 18vh;
height: 18vh;
border-radius: 100px;
top: 5vh;
display:flex;
justify-content:center;
align-items:center;
margin-left: auto;
margin-right:auto;
}
.modind .hosind .promind .kompind {
width: 100%;
}
.ciarka {
margin-top: 10%;
}
.iuii {
width: 115px;
height:115px;
border-radius: 100px;
top: 5vh;
display: flex;
justify-content:center;
align-items:center;
margin-left: auto;
margin-right:auto;
}
.objednavkaformularo{
float: right;
padding: 5%;
border-right: 2px solid black;
vertical-align: middle;
}
.iui img{
vertical-align:middle;
display:inline-block;
}
.iuii img {
}
.idd {
font-size: 20px;
font-weight: bold;
}
.textik {
font-size: 16px;
width: 60%;
height: 1vh;
margin: 0 auto;
}
.resized {
display: none;
}
.penisnadpis {
margin-left: 1%;
color: rgb(236,212,146);
}
/* pokus o responsivitu */
#media only screen and (max-width: 700px) {
body {
}
#PART1 {
display: none;
}
footer {
position: fixed;
bottom: 0;
}
.uo{
margin-top: 0%;
}
.penisnadpis {
margin-left: 0%;
}
.iui {
float: left;
margin-left: 10vw;
}
.iuii {
float: left;
margin-left: 10vw;
}
.uo {
display: none;
}
.resized {
display: block;
margin-top: 5%;
margin-bottom: 20%;
width: 100%;
}
.texticek {
font-size: 17px;
}
.ibutton {
margin-top:5vh;
}
}
#media only screen and (max-width: 1100px) {
body {
}
#PART1 {
width: 100%;
}
}
#media only screen and (max-width: 1550px) {
body {
background-color:
}
.textik {
width: 85%;
}
#PART1{
width: 90%;
}
}
#media only screen and (max-width: 1000px) {
body {
background-color:
}
#PART1{
width:100%;
}
.textik {
width:95%;
font-size: 13px;
}
.uo {
margin-top: 40%;
}
}
#media only screen and (max-height: 600px) {
body {
}
.telicko {
height:100%;
}
footer {
margin-top: 3%;
}
}

iPhone uses smallest media query

I am new to making responsive websites and from what I have discovered is that you can make a responsive website in 2 different ways, the first is by making everything fluid or like I have done, creating #media screen only and (min-width: 640px) { for a variety of window sizes (max-width: 639px, min-width: 640px, min-width: 760px, min-width: 1020px and min-width: 1280px).
With each of these media queries I have designed the website to suit certain devices in mind, for example 640px is aimed for iPhone. However when uploading the website and viewing it on my iPhone the page was really messed up with scaling all wrong which lead to adding <meta name = "viewport" content = "width = device-width"> but this has lead to my website showing the smallest media query on my iPhone. I can't get the website to display properly on my iPhone with the right media query but on my laptop when I adjust the window size the website changes appropriately.
What am I doing wrong?
The page can be seen here, ivybridgemethodistchurch.co.uk/DEV/index.html.
#media only screen and (max-width: 639px) {
#wrapper {
}
#ne_wrapper {
width: 500px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.ne {
width: 100%;
height: 130px;
overflow: auto;
margin-top: 20px;
background: #FFF;
position: relative;
}
.ne img {
width: 130px;
margin: 0;
float: left;
position: absolute;
z-index: 100;
}
#ne_tag {
padding: 5px 0;
margin: 0;
position: absolute;
z-index: 200;
top: 0;
left: 0;
background: rgba(67, 149, 142, 0.85);
}
#ne_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#ne_container {
width: 330px;
margin: 20px;
float: right;
}
#ne_title {
margin-bottom: 10px;
}
#te_wrapper {
width: 500px;
margin: 40px auto;
padding-left: 20px;
padding-right: 20px;
}
.te {
width: 500px;
height: 500px;
padding: 0;
position: relative;
overflow: auto;
}
.te img {
width: 100%;
position: absolute;
z-index: 100;
}
#te_container {
margin: 10px;
float: left;
position: absolute;
z-index: 200;
}
#te_title {
float: left;
padding: 15px;
background: #FFF;
}
#te_title h1 {
float: left;
}
#te_details {
float: left;
padding: 15px;
background: #FFF;
}
#te_tag {
float: left;
clear: both;
padding: 5px 0;
margin: 0;
background: rgba(67, 149, 142, 1);
}
#te_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#te_description {
display: none;
}
#pe_wrapper {
width: 500px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.pe {
width: 100%;
overflow: auto;
margin-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #FFF;
}
.pe img {
width: 100px;
float: left;
margin-right: 10px;
}
#pe_container {
width: 350px;
overflow: auto;
float: right;
padding: 20px;
background: #FFF;
}
#pe_title {
padding-bottom: 10px;
margin-bottom: 15px;
border-bottom: 1px solid #DDD;
}
.no_1 {
margin-top: 20px;
}
}
#media only screen and (min-width: 640px) {
#nav {
width: 100%;
height: 55px;
background: red;
border-bottom: 1px solid #DDD;
position: absolute;
}
#outer {
top: 55px;
width: 100%;
position: absolute;
}
#wrapper {
}
#ne_wrapper {
background: purple;
width: 600px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.ne {
width: 100%;
min-height: 150px;
overflow: auto;
margin-top: 20px;
background: #FFF;
position: relative;
}
.ne img {
width: 150px;
float: left;
position: absolute;
z-index: 100;
}
#ne_container {
width: 410px;
margin: 20px;
float: right;
}
#ne_title {
padding-bottom: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #DDD;
}
#ne_tag {
padding: 5px 0;
margin: 0;
position: absolute;
z-index: 200;
top: 0;
left: 0;
background: rgba(67, 149, 142, 0.85);
}
#ne_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#te_wrapper {
width: 600px;
height: auto;
margin: 40px auto;
padding-left: 20px;
padding-right: 20px;
}
.te {
width: 600px;
height: auto;
padding: 0;
position: relative;
overflow: auto;
}
.te img {
width: 350px;
float: left;
position: relative;
}
#te_container {
width: 250px;
margin: 0;
float: right;
position: inherit;
}
#te_tag {
padding: 5px 0;
margin: 0;
position: absolute;
z-index: 200;
top: 0;
left: 0;
background: rgb(67, 149, 142);
}
#te_tag small {
color: #FFF;
margin: 0;
margin-left: 20px;
margin-right: 20px;
padding: 0;
}
#te_title {
width: 220px;
float: left;
padding: 15px;
background: rgba(255, 255, 255, 0.95);
}
#te_title h1 {
float: left;
}
#te_details {
width: 220px;
float: left;
margin-top: 1px;
padding: 15px;
background: rgba(255, 255, 255, 0.95);
}
#te_description {
display: none;
}
#pe_wrapper {
width: 600px;
margin: 0 auto;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
.pe {
width: 100%;
overflow: auto;
margin-top: 20px;
background: #FFF;
}
.pe img {
width: 120px;
float: left;
}
#pe_title {
padding-bottom: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #DDD;
}
#pe_container {
width: 440px;
margin: 20px;
float: left;
}
}
#media only screen and (min-width: 760px) {
#wrapper {
}
#ne_wrapper {
width: 720px;
}
#ne_container {
width: 530px;
}
#te_wrapper {
width: 720px;
margin-bottom: 20px;
}
.te {
width: 720px;
}
#te_container {
width: 370px;
}
#te_title {
width: 340px;
}
#te_details {
max-width: 340px;
}
#pe_wrapper {
width: 720px;
overflow: auto;
}
#st {
width: 350px;
float: left;
}
#nd {
width: 350px;
float: right;
}
.pe {
width: 350px;
height: 457px;
position: relative;
}
.pe img {
width: 350px;
}
#pe_container {
width: 310px;
margin: 10px;
padding: 10px;
height: auto;
position: absolute;
bottom: 0;
background: #FFF;
}
}
#media only screen and (min-width: 1020px) {
#wrapper {
width: 980px;
margin: 0 auto;
}
#ne_wrapper {
width: 910px;
float: left;
}
.ne {
width: 700px;
background: transparent;
border-left: 10px solid rgb(67, 149, 142);
}
#ne_inner {
margin-left: 20px;
}
#ne_tag {
display: none;
}
#ne_container {
width: 490px;
min-height: 110px;
background: #FFF;
padding: 20px;
margin: 0;
}
#te_wrapper {
width: 940px;
}
.te {
width: 740px;
}
#te_container {
width: 340px;
padding: 20px;
background: #FFF;
}
#te_title,
#te_details {
margin: 0;
padding: 0;
}
#te_title {
padding-bottom: 10px;
border-bottom: 1px solid #DDD;
}
#te_details {
padding-top: 10px;
}
#pe_wrapper {
width: 940px;
clear: both;
}
#st,
#nd {
width: 100%;
float: left;
clear: both;
}
.pe {
width: 300px;
height: 405px;
float: left;
background: #FFF;
}
.pe img {
width: 300px;
}
#pe_container {
width: 260px;
}
.no_1,
.no_2,
.no_4,
.no_5 {
margin-right: 20px;
}
}
#media only screen and (min-width: 1280px) {
#wrapper {
width: 1120px;
margin: 0 auto;
overflow: auto;
}
#ne_wrapper {
width: 1090px;
margin: 0 auto;
padding-left: 0;
padding-right: 0;
float: left;
padding-bottom: 20px;
}
.ne {
width: 730px;
}
#ne_container {
width: 520px;
}
#te_wrapper {
width: 1120px;
}
.te {
width: 1120px;
height: 360px;
position: relative;
}
.te img {
width: 360px;
position: absolute;
z-index: 100;
}
#te_container {
width: auto;
position: absolute;
z-index: 200;
top: 20px;
left: 350px;
margin: 0;
padding: 0;
background: transparent;
}
#te_tag {
background: rgb(67, 149, 142);
}
#te_title {
width: auto;
max-width: 730px;
overflow: auto;
float: none;
padding: 20px;
margin: 0;
margin-top: 28px;
background: #FFF;
border-bottom: 1px solid #F4F1EB;
}
#te_details {
float: none;
overflow: auto;
padding: 20px;
margin: 0;
background: #FFF;
border-bottom: 1px solid #F4F1EB;
}
#te_description {
display: block;
width: 730px;
position: absolute;
z-index: 200;
margin: 0;
padding: 20px;
background: #FFF;
}
#te_description h5 {
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
font-weight: 300;
}
#pe_wrapper {
width: 1120px;
margin: 0 auto;
clear: both;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
}
#st,
#nd {
width: 100%;
float: left;
clear: both;
}
.pe {
width: 360px;
height: 480px;
}
.pe img {
width: 360px;
}
#pe_container {
width: 300px;
margin: 20px;
}
.no_1,
.no_2,
.no_4,
.no_5 {
margin-right: 20px;
}
}
#media only screen and (min-width: 1360px) {
}
Your media queries are not correct
#media only screen and (max-width: 639px) { }
#media only screen and (min-width: 640px) { }
#media only screen and (min-width: 760px) { }
#media only screen and (min-width: 1020px) { }
#media only screen and (min-width: 1280px) { }
#media only screen and (min-width: 1360px) { }
This will result in applying styles of #media only screen and (max-width: 639px) { } because all other media queries are overridden by it as you have given min-width to all queries, thus it takes lowest min-width and applies it for all sizes.
Change it to
#media only screen and (max-width: 639px) { }
#media only screen and (min-width: 640px) and (max-width: 759px) { }
#media only screen and (min-width: 760px) and (max-width: 1019px) { }
#media only screen and (min-width: 1020px) and (max-width: 1279px) { }
#media only screen and (min-width: 1280px) and (max-width: 1359px) { }
#media only screen and (min-width: 1360px) { }
To explain you media queries in detail, refer css getting changed when applying css media queries for responsive design
I will also put some part of that answer here for further reviews of this post.
include this in <head></head> (if you have not)
<meta name="viewport" content="width=device-width, user-scalable=no" /> <-- user-scalable=yes if you want user to allow zoom -->
change you #media style as this // change width as per your requirements
#media only screen (max-width: 500px) {
// or as per your needs, as I try to explain below
}
Now I try to explain maybe..:)
#media (max-width:500px)
for a window with a max-width of 500px that you want to apply these styles. At that size you would be talking about anything smaller than a desktop screen in most cases.
#media screen and (max-width:500px)
for a device with a screen and a window with max-width of 500px apply the style. This is almost identical to the above except you are specifying screen as opposed to the other media types the most common other one being print.
#media only screen and (max-width:500px)
Here is a quote straight from W3C to explain this one.
The keyword ‘only’ can also be used to hide style sheets from older user agents. User agents must process media queries starting with ‘only’ as if the ‘only’ keyword was not present.
As there is no such media type as "only", the style sheet should be ignored by older browsers.
Example
#media all and (min-width: 500px) {
}
#media all and (max-width: 500px) and (min-width: 300px) {
}
#media all and (max-width: 299px) {
}