gpt4 book ai didi

css - 我怎样才能正确地 "position: fixed"一个 div ?

转载 作者:行者123 更新时间:2023-12-02 09:00:03 24 4
gpt4 key购买 nike

如果您愿意看一下我的网站 http://www.metroflatsmiami.com/listing.html ,你会看到我在右侧有一个 float 的 DIV,但问题是它位于左侧。如果您调整窗口大小(或具有不同的分辨率),它看起来就会不正确。我希望它始终位于主要内容 DIV 的右侧,但仍在滚动......有什么想法吗?

CSS:

.floating_price_box {
position:fixed;
width: 200px;
border: solid 1px black;
height: 400px;
top: 50px;
left: 1000px;
}

最佳答案

使用 jQuery:

$(window).bind("load resize", function(){
$('.right-block').width($('.main-block').width() - (25));
});

关于css - 我怎样才能正确地 "position: fixed"一个 div ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1978098/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com