fond de taille en sténographie, propriété de l'arrière plan (CSS3)

Je suis en train de mélanger background-image et background-size propriétés dans un shorthanded background de la propriété. Basé sur documentation du W3C background-size devrait venir après background-position bien séparés par une barre oblique(/).

W3C exemple:

p { background: url("chess.png") 40% / 10em gray
       round fixed border-box; } 

est équivalent à:

p {
    background-color: gray;
    background-position: 40% 50%;
    background-size: 10em 10em;
    background-repeat: round round;
    background-clip: border-box;
    background-origin: border-box;
    background-attachment: fixed;
    background-image: url(chess.png) }

SOCIÉTÉ dit la même chose. J'ai aussi trouvé cette et cette article sur la sténographie CSS3 propriété background expliquant cela.

Mais ce n'est pas de travail! Il n'est pas aussi clair comment faire un raccourci background bien quand background-size et background-position avoir deux valeurs différentes pour background-position-x et background-position-y ou même chose pour background-size. Il n'est pas clair comment la barre oblique(/) prend place? Cet exemple n'est pas de travail dans mon Chrome 15.

Exemple, j'ai essayé de faire une abréviation est ce code CSS:

div {  
    background: url(http://www.placedog.com/125/125) 
        0 0 /  150px 100px 
        repeat no-repeat 
        fixed border-box padding-box blue;      
    height: 300px;
    width:360px;    
    border: 10px dashed magenta;  
}

Un nettoyant exemple

Ce travail est (JSFiddle)

 body{
        background-image:url(http://www.google.com/intl/en_com/images/srpr/logo3w.png);
        background-position:200px 100px;
        background-size:600px 400px;
        background-repeat:no-repeat;
    }

Ce n'est pas de travail (jsfiddle)

body{
    background:url(http://www.google.com/intl/en_com/images/srpr/logo3w.png) 200px 100px/600px 400px no-repeat;
}

Ce n'est pas trop(jsfiddle)

body{
    background:url(http://www.google.com/intl/en_com/images/srpr/logo3w.png) 200px/400px 100px/600px no-repeat;
}
  • Méfiez-vous de Safari pas l'appui de fond de taille sténo! Safari ne le supporte pas! Mettez votre fond de taille distincte de votre fond de garder Safari de l'étouffement sur elle!
InformationsquelleAutor Mohsen | 2011-10-23