Zum Inhalt springen

Retina Display: Unterschied zwischen den Versionen

Aus Computech CMS Wiki
Simon Zeberli (Diskussion | Beiträge)
Die Seite wurde neu angelegt: „==CSS== →for low resolution display: .image { background-image: url(/path/to/my/lowreslogo.png); background-size: 200px 300px; height: 300px; …“
 
Simon Zeberli (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
==CSS==
==CSS==
/* for low resolution display */
  /* for low resolution display */
.image {
  .image {
     background-image: url(/path/to/my/lowreslogo.png);
     background-image: url(/path/to/my/lowreslogo.png);
     background-size: 200px 300px;
     background-size: 200px 300px;
     height: 300px;
     height: 300px;
     width: 200px;
     width: 200px;
}
  }
/* for high resolution display */
  /* for high resolution display */
@media only screen and (min--moz-device-pixel-ratio: 2),
  @media only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
  only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
  only screen and (min-device-pixel-ratio: 2) {
.image {
  .image {
     background: url(/path/to/my/highreslogo.png) no-repeat;
     background: url(/path/to/my/highreslogo.png) no-repeat;
     background-size: 200px 400px;
     background-size: 200px 400px;
/* rest of your styles... */
  /* rest of your styles... */
}
  }
}
  }


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

Version vom 13. April 2013, 22:17 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... */
 }
 }