Css-background-attachment

提供:Dev Guides
2020年6月22日 (月) 22:39時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

CSS-バックグラウンド添付

説明

background-attachmentは、背景画像のタイルコンテキストとスクロール状態を決定します。

可能な値

  • scroll -スクロールするように設定された背景画像は、ドキュメントの残りの部分とともにスクロールします。
  • fixed -固定に設定された背景画像は、ドキュメントの残りがスクロールしている間、所定の位置にロックされたままになります。

に適用されます

すべてのHTML要素。

DOM構文

object.style.backgroundAttachment = scroll | fixed;

<html>
   <head>
   </head>

   <body>
      <p style = "background-image:url(/images/logo.png);
         background-attachment:scroll;
         background-attachment:scroll;
         background-repeat: no-repeat;
         background-attachment: fixed;">

         This parapgraph has scrolling background image.
         This parapgraph has fixed repeated background image.
         This parapgraph has fixed repeated background image.
         This parapgraph has fixed repeated background image.
         This parapgraph has fixed repeated background image.
         This parapgraph has fixed repeated background image.
      </p>

   </body>
</html>

それは次の結果を生成します-