Css-background
提供:Dev Guides
CSS-背景
説明
backgroundは、要素の背景スタイルを設定するために使用される省略形の要素です。
可能な値
backgroundは略記プロパティであり、次のことを表します。 この値は、実際のプロパティによって異なります。
- background-color -要素の背景、パディング、および境界線の背景に単色を設定します。
- background-image -要素の背景に配置される画像の場所を定義します。
- background-repeat -要素の背景にある画像の繰り返し方向を設定します。
- background-attachment -要素の背景にある画像の添付状態を設定します。
- background-position -要素の背景の原点画像の位置を設定します。
- background-clip -背景画像の描画領域を指定します
に適用されます
すべてのHTML要素。
DOM構文
object.style.background = "Value according to the used property";
例
<html>
<head>
</head>
<body>
<p style = "background:url(/images/logo.png) repeat fixed;">
This paragraph has fixed repeated background image.
This paragraph has fixed repeated background image.
This paragraph has fixed repeated background image.
This paragraph has fixed repeated background image.
</p>
</body>
</html>
それは次の結果を生成します-