gpt4 book ai didi

css背景图片定位

转载 作者:太空宇宙 更新时间:2023-11-03 19:20:49 24 4
gpt4 key购买 nike

我需要有关在网页上定位两张图片的帮助。我希望两张图片都固定在页面上,所以一张固定在页面的左上角,另一张固定在右下角。但我也希望背景是黑色的,这样如果有很多文字或内容,那么两个图像都会加长。下面是一张有助于解决问题的图片。

http://www.imagecross.com/11/image-hosting-view-53.php?id=4949contextual.png

最佳答案

示例 html

<div id="topLeft"></div>
<div id="bottomRight"></div>

CSS:

BODY {
background-color: black;
}

#topLeft {
width: 100px; height: 100px;
background: url('http://cvcl.mit.edu/hybrid/cat2.jpg');
position: absolute;
top: 0px;
left: 0px;
}

#bottomRight {
width: 100px; height: 100px;
background: url('http://cvcl.mit.edu/hybrid/cat2.jpg');
position: absolute;
bottom: 0px;
right: 0px;
}

根据口味调整高度和宽度

关于css背景图片定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3965306/

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