I have made a simple website which is responsive (more or less). I have used media query @media only screen and (max-width: 699.99px)
. Now I know that this will activate the css inside it when resolution is less than 699.99px. So it is fine with computer but it doesn't work in mobiles and I know why. But I don't really understand how to solve this. I want this query to work on computer screen (resizing) as well as mobile devices and tablets.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
could be an issue with difference between real screen width and actual size
or you can use media-device-width
but I suggest you to start with mobile-first approach that will definitely solve the issue. basically first you do css for mobile and then you override css for desktop with media queries like
btw does your device support 699.99px? try using 700 instead
You can use
em
orrem
instead ofpx
. This makes the styling depend on how much content fits on the screen assuming that you also useem
/rem
to set the sizes of your elements.First of all if you want make your website responsive it's better to use responsive framework like Bootstrap or foundation.
but if you prefer to do it without framework. try this
you can make 4 media query steps
and extra guide
I hope this can help