简体   繁体   English

background-image将不会显示在CSS容器中

[英]background-image won't display in CSS container

Directory Info I seem to be having problems with this container. 目录信息我似乎对此容器有问题。 Any text I put in will display but the background image will not. 我输入的任何文本都会显示,但背景图像不会显示。 I made a tag with a class of my catimage (category image). 我用我的catimage (类别图像) 类标记了标签

/*css for catogories*/
.catimage {
    width: 250px;
    height: 250px;
    position: relative;
    background-image: url(C:\server\media\site_pictures\tools.jpg);
}

/*html stuff*/
<div class="catimage"></div>

图片的网址必须与请求它的文件有关。

background-image: url(./media/site_pictures/tools.jpg);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM