Advertisement
Guest User

retina/high rest span image (css)

a guest
Jun 30th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.50 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>responsive image : span images</title>
  6.     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7.    
  8.     <style>
  9.        
  10.         .img{
  11.             display: inline-block;
  12.             vertical-align: baseline;
  13.             overflow: hidden;
  14.             background-size: 100% auto;
  15.             background-position: 0 0;
  16.             position: relative;
  17.         }
  18.        
  19.         .img.site-logo-png{
  20.             background-image: url('http://lorempixel.com/400/200/city/6/normal/');
  21.             width: 400px;
  22.             height: 200px;
  23.         }
  24.        
  25.        
  26.         /* Retina-specific stuff here - http://css-tricks.com/snippets/css/retina-display-media-query/  */
  27.  
  28.  
  29.         @media
  30.         only screen and (-webkit-min-device-pixel-ratio: 2),
  31.         only screen and (   min--moz-device-pixel-ratio: 2),
  32.         only screen and (        moz-device-pixel-ratio: 2),
  33.         only screen and (      -o-min-device-pixel-ratio: 2/1),
  34.         only screen and (        min-device-pixel-ratio: 2),
  35.         only screen and (              min-resolution: 192dpi),
  36.         only screen and (                min-resolution: 2dppx) {
  37.            
  38.             .img.site-logo-png{
  39.                 background-image: url('http://lorempixel.com/800/400/city/6/HIGHRES/');
  40.             }
  41.  
  42.         }
  43.        
  44.        
  45.     </style>
  46.    
  47. </head>
  48. <body>
  49.    
  50.     <p>
  51.         <span class="img site-logo-png"></span>
  52.         Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repellat, sit, corrupti dicta quod quo atque alias natus a unde voluptatem architecto perspiciatis modi perferendis ex odio similique deleniti voluptatum. Itaque.
  53.     </p>
  54.    
  55.    
  56.    
  57.    
  58. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement