Using the @media rules is not recommended, as the pixel size on the mobile device and on the desktop may vary.
For example, instead of:
@media only screen and (min-device-width : 480px) and (max-device-width : 800px) and (orientation : landscape) { } @media only screen and (min-device-width : 480px) and (max-device-width : 800px) and (orientation : portrait) { }
Add a container that has a left margin of 5% and margin-right of 5%:
<body> <div class="container"> # Your body goes here </div> </body>
I found this a much more user-friendly and supported approach to responsive design than the standard @media rule.
source share