I am having trouble with my css media queries. They work great on the computer but don't work on my iPhone. Here is what i have:
@media only screen and (max-width: 400px) {
.logInCenter{
width:90%;
left:0;
top:0;
margin-left:0px !important;
}
}
@media only screen and (min-width: 401px) and (max-width: 768px) {
.fluid-half
{
display:block;
padding:20px 0px;
width:100%;
float:none;
}
}
@media only screen and (min-width: 769px) and (max-width: 991px) {
}
@media only screen and (min-width: 992px) and (max-width: 1199px) {
}
@media only screen and (min-width: 1200px) {
}
The problem is that my iPhone only detects the styles when I put them in the third media query. The issue is that at 100% width, it looks just like any other desktop site. Really far away. I hope that makes sense! thanks!
Have you made sure that the following code is in your HTMl head? Tells the devise to look at viewport sizes.
<meta name="viewport" content="width=device-width">
Since you are using css media queries, you should not use meta tag in your html file. You can set the same in css using:
@viewport {
width: device-width;
zoom:1;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With