English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

manuel de référence CSS

règles RULES CSS

大全 des attributs CSS

CSS3 background-Usage and examples of the origin attribute

CSS background-The origin attribute specifies the positioning area of the background, that is, usingbackground-imageThe position of the image origin specified by the attribute.

The following table summarizes the usage context and version history of this attribute.

Default value:padding-box
Applicable to:All elements. It is also applicable to::first-letterand::first-line
Inheritance:None
Animation making possible:否。请参见 Non.
Voir également CSS3Attributs d'animation
Version :    nouvelle fonction    JavaScript Syntaxe:-object

background-object.style.backgroundOrigin="content

box"

background-Syntaxe d'utilisation de origin-La syntaxe de cet attribut est la suivante :-box | padding-box | content

box | initial | inherit-Les exemples suivants montrent comment utiliser background

Exemple
    .box { 25height:
    width: 15height:
    0px; 10padding:
    px; 6border:333px dashed #
    ;/background: url("images-sky.jpg") no
    background-repeat;
    background-size: contain;-origin: content
box;
}/Vérifiez ici‹

Note :-Si l'attribut valeur est ignorébackground-attachmentL'attribut est spécifié comme fixed.

Valeur de l'attribut

Le tableau suivant décrit les valeurs de cet attribut.

ValeurDescription
border-boxSpécifie que le fond s'étend à l'extérieur des bords. Le fond est dessiné sous la bordure.
padding-boxSpécifie que le fond s'étend à l'extérieur des bords du remplissage. Le fond n'est pas dessiné sous la bordure. C'est la valeur par défaut.
content-boxSpécifie que le fond est dessiné uniquement à l'intérieur de la boîte de contenu (coulée). Le fond n'est pas dessiné sous la bordure et la zone de remplissage.
initialRéinitialisez cette propriété à sa valeur par défaut.
inheritSi spécifié, l'élément lié utilise le background de son élément parent-Valeur calculée de l'attribut origin.

Compatibilité du navigateur

background-Compatibilité du navigateur pour l'attribut origin, tous les navigateurs populaires prennent en charge cet attribut.

  • Firefox 4+

  • Google Chrome4+

  • Internet Explorer 9+

  • Apple Safari 3+

  • Opera 10.5+

Pour en savoir plus

Veuillez consulter les tutoriels suivants :CSS3Arrière-planCSS3Arrière-plan

Attributs associés :backgroundbackground-attachmentbackground-colorbackground-imagebackground-clipbackground-positionbackground-repeatbackground-size