Basically, I am resetting all my font-size to work with all screen sizes. basically i am resetting to 10px.
the issue is, one of the query i am using here:
#media screen and (min-width: 321px) and (max-width: 480px) {
body {
font: normal 2.083333333333333vw/1 normal sans-serif;
}
}
Is not giving correct output to 360 screen size. since above sets from 321 to 480 - but not setting with 360 screen.
what is the wrong here?
Here is my full resetting to 10px to all view ports.
p {
font-size: 1.2em; //in all media it will be 12px.
}
#media screen and (max-width: 320px) {
body {
font: normal 3.125vw/1 normal sans-serif;
}
}
#media screen and (min-width: 321px) and (max-width: 480px) {
body {
font: normal 2.083333333333333vw/1 normal sans-serif;
}
}
#media screen and (min-width: 481px) and (max-width: 640px) {
body {
font: normal 1.5625vw/1 normal sans-serif;
}
}
#media screen and (min-width: 641px) and (max-width: 768px) {
body {
font: normal 1.305483028720627vw/1 normal sans-serif;
}
}
#media screen and (min-width: 769px) and (max-width: 1920px) {
body {
font: normal 1vw/1 normal sans-serif;
}
}
UPDATE
What i expect is : whatever the view port size, the min-font size should be 10px.example (320px) and more than this view-port the font-size should be maxium 14px. how to make this?
Related
I'm trying to make my text responsive on my wordpress theme but I'm having problems with the media query
I've looked all over and nothing has been able to help
https://ibb.co/w6bSdJ9
#media (min-width: 320px) and (max-width: 680px) {
h2.h2 {
font-size: 12px;
}
}
#media screen and (max-width: 680px)
{
.heading-text h2 {
font-size: 12px;
}
}
solved it:
-webkit-text-size-adjust: 100%;
/* Prevent font scaling in landscape while allowing user zoom */
I have a small font-sizing issue when rotating from portrait to landscape. When testing on responsive mode in safari the font-sizing is working fine, but when testing it on my iPhone 5s the font-size works fine in portrait mode, right font-size the way i set, turning to landscape bigger font-size. The navigation shows the right font-size, but when opening it also changes bigger. All the font-sizing is done on the body tag with px, don't need to specify it separately or use em,rem etc. Can't find where the problem is. Again in responsive mode Safari everything is working.
* {
margin: 0;
padding: 0;
}
body {
font-family: helvetica, arial, sans-serif;
font-size: 23px;
font-weight: normal;
text-align: left;
line-height: 1.2;
color: black;
}
h1, h2 {
font-size: inherit;
font-weight: inherit;
text-decoration: none;
-webkit-hyphens: auto;
hyphens: auto;
}
#media screen and (max-width: 1112px) { /* all after this breakpoint size to 20px */
body {
font-size: 20px;
}
}
#media screen and (max-width: 1024px) { /* all after this breakpoint size to 18px */
body {
font-size: 18px;
}
}
Try to use this media queries:
#media
only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1025px),
only screen and ( min--moz-device-pixel-ratio: 2) and (max-width: 1025px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (max-width: 1025px),
only screen and ( min-device-pixel-ratio: 2) and (max-width: 1025px),
only screen and ( min-resolution: 192dpi) and (max-width: 1025px),
only screen and ( min-resolution: 2dppx) and (max-width: 1025px) {
body {
font-size: 18px;
}
}
For iPhone7 I use this media query:
#media only screen
and (device-width : 375px)
and (-webkit-device-pixel-ratio : 3) {
body {
font-size: 18px;
}
}
Also, you can combine this media queries to resolve your issue.
#media only screen and(max-width: 1132px) {
#yc-contact{
margin-left: 50px;
}
}
#media screen and(max-width: 1132px) {
#yc-contact{
margin-left: 50px;
}
}
The above code works in Safari but fails to work in Chrome. Tried both.
It seems a syntax error. Try to put a space after "and"
#media only screen and (max-width: 1132px) {
#yc-contact{
margin-left: 50px;
}
}
Please Apply this code :
/* ----------- Non-Retina Screens ----------- */
#media screen
and (max-device-width: 1132px)
and (-webkit-max-device-pixel-ratio: 1)
{
#yc-contact{margin-left: 50px;}
}
/* ----------- Retina Screens ----------- */
#media screen
and (max-device-width: 1132px)
and (-webkit-max-device-pixel-ratio: 2)
and (max-resolution: 192dpi)
{
#yc-contact{margin-left: 50px;}
}
Problem: I have the following styling that targets mobile phones for the footer:
#media (max-width: 800px){
#footer-affiliation {
background-color: #0077C0;
color: rgb(255, 255, 255);
padding: 5px;
height:110px;
width:109.01% !important;
margin-left:-15px;
}
}
However, it affects the footer on the IPAD. I did the following to target only IPAD's and IPhones. For the iphone css styling works fine, however for the IPAD styling is not working:
#media only screen
and (min-device-width : 480px)
and (max-device-width : 800px)
and (orientation : portrait) {
#footer-affiliation {
background-color: #0077C0;
color: rgb(255, 255, 255);
padding: 5px;
height:110px;
width:104% !important;
margin-left:-15px;
}
}
I would like to know what other approach I can do to target IPAD's only.
Thank You
For targeting iPad use following media query
#media only screen and (device-width: 768px) {
/* For general iPad layouts */
}
#media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) {
/* For portrait layouts only */
}
#media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) {
/* For landscape layouts only */
}
Detailed info available in this site for various device in iPad
CSS media Queries for iPad
I have below script, it's doing fine in firefox and chrome. ie9 doesn't show the change of colors.
<style type="text/css">
body {
background-color: #FF77BB;
}
#media screen and (max-width: 960px) {
body {
background-color: #8A2BE2;
}
}
#media screen and (max-width: 768px) {
body {
background-color: #FF8C00;
}
}
#media screen and (max-width: 550px) {
body {
background-color: #7FFF00;
}
}
#media screen and (max-width: 320px) {
body {
background-color: #CC0011;
}
}
}
</style>
Works fine for me, just get rid of the extra } at the very end, the other browsers may not make it an issue but IE9 is very picky, if one thing is off it breaks the whole thing.