How to change the face of the site when accessed by the mobile?

0

Situation:

I have a designer site for large screens , I created a template for mobile, type an application. So I want this template to be shown only when accessed by the mobile, instead show the conventional.

How do I do this? Is there any command or tag for this in html or css?

    
asked by anonymous 04.08.2017 / 03:26

1 answer

2

Use the CSS media queries.

CSS Tricks has a repository with media queries for main screens.

Example usage:

@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 480px)
  and (-webkit-min-device-pixel-ratio: 2) {

  /** Formatar o menu para telas de iPhone 4 e 4s **/
  nav {
    color: white;
    background-color: #333333;
    position: fixed;
    top: 0;
  }

}
    
04.08.2017 / 05:46