Hier ist meine Medienabfrage:Wie stellen Sie Querformat- und Querformat-Medienabfragen in CSS ein?
@media screen and (min-device-width: 768px) and (max-device-width: 1824px) and (orientation : portrait){
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important ;
}
.visible-tablet {
display: inherit !important;
}
.hidden-tablet {
display: none !important;
}
}
@media screen and (min-device-width: 768px) and (max-device-width: 1824px) and (orientation : landscape){
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important ;
}
.visible-tablet {
display: inherit !important;
}
.hidden-tablet {
display: none !important;
}
}
@media screen and (max-device-width: 767px) and (orientation: portrait) {
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important;
}
.visible-phone {
display: inherit !important;
}
.hidden-phone {
display: none !important;
}
}
@media screen and (max-device-width: 767px) and (orientation: landscape) {
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important;
}
.visible-phone {
display: inherit !important;
}
.hidden-phone {
display: none !important;
}
}
Aber in Tabletten-, wenn es im Querformat ist, wird dieses div
.visible-tablet {
display: inherit !important;
}
zeigt Wenn es im Portrait-Modus ist, wird dieses div zeigt
Ich möchte diese div .visible-tablet
immer angezeigt werden, wenn ich mein Tablet in Auto-Rotate-Modus (die für Hoch-und Querformat sein wird) wechseln
Aber ich habe Portrait- und Landschaftsbedingungen verwendet, aber ich stehe immer noch vor diesem Problem. Irgendwelche Kommentare?
für Smartphones? –
Sie können ... http://css-tricks.com/snippets/css/media-queries-for-standard-devices/ –
Sowohl "min-device-width" als auch "max-device-width" [sind veraltet] (https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries). – lowtechsun