gpt4 book ai didi

HTML - 高度不是 100%

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

body {
height: 100%;
background-color: #f8f8f8 ;
background-image: url('images/bottom-right.png'); /*Images*/
background-position: right bottom; /*Positioning*/
background-repeat: no-repeat; /*Prevent showing multiple background images*/
}

所以我有这段代码将图像放在正文的右下角,但问题是它没有按我想要的方式定位。它向右但不在底部。它只和里面的内容一样高,就像 div 或其他任何东西一样。你能帮我实现我想要的吗?

这是图片 -> http://tinypic.com/view.php?pic=2iabd3p&s=8谢谢

最佳答案

您还需要在 html 上设置高度并移除 body 上的边距:

body {
height: 100%;
background-color: #f8f8f8;
background-image: url('http://www.placehold.it/100x100');
background-position: right bottom;
background-repeat: no-repeat;
margin:0;
padding:0;
}
html {
height:100%;
}

jsFiddle example

关于HTML - 高度不是 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23819826/

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