cuốn sách gpt4 ai đã làm

javascript - 位置 :absolute div inside another position:absolute div and making them position:fixed

In lại Tác giả: Walker 123 更新时间:2023-11-28 11:04:23 29 4
mua khóa gpt4 Nike

HTML





CSS

div1、div2 和 div3 的属性是:

 div1. {
vị trí: tuyệt đối;
chỉ số z: 100;
background-color: rgba(39, 39, 39, 0.3);
height: 90px;
width: 712px;
left: 0px;
bottom: 216px;
}

.div2 {
vị trí: tương đối;
}

.div3 {
vị trí: tuyệt đối;
bottom: 263px;
margin-left: 50px;
}

现在根据我的概念,div1 是绝对的,我应该将 div3 设置为绝对的,从而将它放在 div1 中。现在我的问题是我需要将 div1 设置为 position:fixed 如果我滚动它它应该在那里但是如果我给出这样的 div 3 不是固定的并且它正在移动。我可以得到这个的棘手点吗

câu trả lời hay nhất

将 div1 和 div3 的位置更改为固定,滚动时它们将保持不变。 div1 的 CSS 中还有一个小错字(句点放在“div1”之后而不是之前)。

.div1 {
vị trí: cố định;
chỉ số z: 100;
background-color: rgba(39, 39, 39, 0.3);
height: 90px;
width: 712px;
left: 0px;
bottom: 216px;
}

.div2 {
vị trí: tương đối;
}

.div3 {
vị trí: cố định;
bottom: 263px;
margin-left: 50px;
}

关于javascript - 位置 :absolute div inside another position:absolute div and making them position:fixed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22319276/

29 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress