gpt4 book ai didi

html - 背景图片不显示

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

我试图通过 CSS 显示我的 Logo ,但它不会显示。

当我检查元素时,它显示图像存在但不会出现在网页上。

代码

#logo_image {
margin-top: 13px;
float: left;
background: url(images/logo_color.png) no-repeat;
padding: 8px 16px 8px 16px;
}
<a href="index.html" id="logo_terra"></a>

最佳答案

你的ID不对,改成#logo_terra,加上widthheight,否则只有填充 大小

#logo_terra {
margin-top: 13px;
float: left;
background: url(//lorempixel.com/100/100) no-repeat;
padding: 8px 16px;
width: 100px;
height: 100px
}
<a href="index.html" id="logo_terra"></a>

关于html - 背景图片不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37600498/

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