且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CSS背景图像不显示

更新时间:2022-06-11 22:47:12

@CBroe评论是精确(您没有显示 a 内容)。然后,要查看图像,您需要将图像设置为#link1 而不是#link1 a 的背景:

The @CBroe comment is precise (you are not displaying the a content). Then, to see the image you need to set the image to background of #link1 and not #link1 a:

#link1 a {
    width: 113px;
    display: block;
}

#link1 {
    background: url('https://www.google.com/images/srpr/logo11w.png') no-repeat;
}