背景の画像のスクロールを制御するためにCSSで使用されるプロパティはどれですか?
背景の画像のスクロールを設定するには、 background-attachmentを使用します プロパティ。
例
次のコードを実行して、 background-attachmentの操作方法を学ぶことができます。 プロパティ:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url('/css/images/css.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-attachment:scroll;
}.
</style>
</head>
<body>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
</body>
</html> -
CSSのBackgroundShorthandプロパティ
CSS背景省略形プロパティは、要素の背景を定義するために使用されます。 background-color、background-image、background-repeat、background-position、background-clip、background-size、background-origin、background-attachmentが一緒になって、CSSの背景プロパティを構成します。 構文 CSSバックグラウンドプロパティの構文は次のとおりです- Selector { background: /*value*/ } 例 次の例は、CSSの背
-
CSSを使用した背景画像の設定
CSSのbackground-imageプロパティは、選択した要素の背景として画像を設定するために使用されます。 構文 CSSbackground-imageプロパティの構文は次のとおりです- Selector { background-image: /*value*/ } 次の例は、CSSのbackground-imageプロパティ-を示しています。 例 <!DOCTYPE html> <html> <head> <style> #demo { margin: 24px; &