2016-08-21 8 views
-1

Wenn ich min-width:368px; im Desktop-Modus nehme funktioniert es aber danach, wie ich Medienabfragen benutze und ich es in max-width:368px (für Handy und Tablet) umwandelt und es funktioniert nicht .Es ist min-width Wert nicht max-width Wert. Warum?.CSS3: max-width & min-width

Beispiel:

min-width: 368px;(desktop); 
max-width: 368px;(mobile, tablet); 

Antwort

0

versuchen Sie dies:

@media screen and (max-device-width: 480px) and (orientation: portrait){ 
/* some CSS here */ 
} 

/* #### Mobile Phones Landscape #### */ 
@media screen and (max-device-width: 640px) and (orientation:landscape){ 
/* some CSS here */ 
} 

/* #### Mobile Phones Portrait or Landscape #### */ 
@media screen and (max-device-width: 640px){ 
/* some CSS here */ 
} 

/* #### iPhone 4+ Portrait or Landscape #### */ 
@media screen and (min-device-width: 320px) and (-webkit-min-device-pixel-ratio: 2){ 
/* some CSS here */ 
} 

/* #### iPhone 5 Portrait or Landscape #### */ 
@media (device-height: 568px) and (device-width: 320px) and (-webkit-min-device-pixel-ratio: 2){ 
/* some CSS here */ 
} 

/* #### iPhone 6 and 6 plus Portrait or Landscape #### */ 
    @media (min-device-height: 667px) and (min-device-width: 375px) and (-webkit-min-device-pixel-ratio: 3){ 
    /* some CSS here */ 
    } 

    /* #### Tablets Portrait or Landscape #### */ 
    @media screen and (min-device-width: 768px) and (max-device-width: 1024px){ 
    /* some CSS here */ 
} 

/* #### Desktops #### */ 
@media screen and (min-width: 1024px){ 
    /* some CSS here */ 
}