Zum Inhalt springen

Retina Display: Unterschied zwischen den Versionen

Aus Computech CMS Wiki
Simon Zeberli (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Frederick (Diskussion | Beiträge)
K Frederick verschob die Seite Retina Dislpay nach Retina Display: Tippfehler
 
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt)
Zeile 1: Zeile 1:
==CSS==
==CSS==
<syntaxhighlight lang="CSS" line start="1" highlight="5" enclose="div">
   /* for low resolution display */
   /* for low resolution display */
   .image {
   .image {
Zeile 18: Zeile 19:
   }
   }
   }
   }
</syntaxhighlight>


==Javascript==
==Javascript==
  /* for low resolution display */
<syntaxhighlight lang="JAVA" line start="1" highlight="5" enclose="div">
  .image {
/* for low resolution display */
    background-image: url(/path/to/my/lowreslogo.png);
.image {
    background-size: 200px 300px;
  background-image: url(/path/to/my/lowreslogo.png);
    height: 300px;
  background-size: 200px 300px;
    width: 200px;
  height: 300px;
  }
  width: 200px;
  /* for high resolution display */
}
  @media only screen and (min--moz-device-pixel-ratio: 2),
/* for high resolution display */
  only screen and (-o-min-device-pixel-ratio: 2/1),
@media only screen and (min--moz-device-pixel-ratio: 2),
  only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2) {
only screen and (-webkit-min-device-pixel-ratio: 2),
  .image {
only screen and (min-device-pixel-ratio: 2) {
    background: url(/path/to/my/highreslogo.png) no-repeat;
.image {
    background-size: 200px 400px;
  background: url(/path/to/my/highreslogo.png) no-repeat;
  /* rest of your styles... */
  background-size: 200px 400px;
  }
/* rest of your styles... */
  }
}
}
</syntaxhighlight>

Aktuelle Version vom 21. September 2015, 21:12 Uhr

CSS

  /* for low resolution display */
  .image {
    background-image: url(/path/to/my/lowreslogo.png);
    background-size: 200px 300px;
    height: 300px;
    width: 200px;
  }
  /* for high resolution display */
  @media only screen and (min--moz-device-pixel-ratio: 2),
  only screen and (-o-min-device-pixel-ratio: 2/1),
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (min-device-pixel-ratio: 2) {
  .image {
    background: url(/path/to/my/highreslogo.png) no-repeat;
    background-size: 200px 400px;
  /* rest of your styles... */
  }
  }

Javascript

/* for low resolution display */
.image {
  background-image: url(/path/to/my/lowreslogo.png);
  background-size: 200px 300px;
  height: 300px;
  width: 200px;
}
/* for high resolution display */
@media only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
.image {
  background: url(/path/to/my/highreslogo.png) no-repeat;
  background-size: 200px 400px;
/* rest of your styles... */
}
}