コンテンツを上に配置できるように、それに応じて 3 つの画像を重ねて背景として機能させたい Web ページがあります。スクロール時に画像が移動してはならないため、固定位置は機能しません。以下は、後ろから前に表示される順序です (1-3)。
- img - html で背景画像として設定した sky.jpg。
- img - sky.jpg の上に設定された backDrop.png。
- img - すべての画像の上と右下に配置したい BtmRight.png 。
両方の画像 (backDrop.png、BtmRight.png) には、順序を決定するための絶対位置と z-index が設定されています。BtmRight.png 画像を他の画像の右下に表示することはできません。ページをスクロールしても、右下の画像はそのままにしておきたいです。また、すべての画像の上にコンテンツを表示したいと思います。以下は私の HTML/CSS です。足りないものはありますか?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style type="text/css">
html {
height: 100%;
margin: 0;
padding: 0;
margin-top:100px;
background: url(sky.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
body {
height: 100%;
margin: 0;
padding: 0;
}
#imgBack {
width: 100%;
margin-top:100px;
position:absolute;
z-index:20;
border:#0FF thin solid;
}
#imgBtmRight {
position:absolute;
z-index:50;
bottom:0;
right:0;
}
</style>
<body>
<img id="imgBtmRight" src="BtmRight.png" width="413" height="283" />
<img id="imgBack" src="backDrop.png" />
</body>
</html>
この件に関する光、または支援をいただければ幸いです。ありがとう