Um ein anderes Stück Code hat je nach Gerät auszuführen die Benutzer Ihrer Website aus zuschauen, ich schlage vor, Sie verwenden @media queries
.
Targeting Smartphones:
Nicht alle Smartphones sind gleich groß, aber als Faustregel verwenden:
@media screen and (device-width: 360px)
and (device-height: 640px)
and (-webkit-device-pixel-ratio: 3) {
.imageelement {
/* Your css code*/
display: block !important;
}
.videoelement {
/* Your css code*/
display: none !important;
}
}
Targeting Tabletten:
Beim Targeting von Tablets sollten Sie die Abmessungen beibehalten auf diesen Bereich:
@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (-webkit-min-device-pixel-ratio: 1) {
.imageelement {
/* Your css code*/
display: block !important;
}
.videoelement {
/* Your css code*/
display: none !important;
}
}
Targeting Laptops und größere Geräte:
Schließlich ist dies, wenn Sie Ihr Video angezeigt werden soll setzen.
@media screen
and (min-device-width: 1200px)
and (max-device-width: 1600px)
and (-webkit-min-device-pixel-ratio: 1) {
.imageelement {
/* Your css code*/
display: none !important;
}
.videoelement {
/* Your css code*/
display: block !important;
}
}
Wenn Sie this page mehr über @media queries
Besuch kennen.
@AtonAskling In welcher Sprache ist die Site geschrieben? – Phil
Tags sind html5 und css also ich rate er spricht über ein html video tag :) – matmik