【发布时间】:2023-01-29 22:55:16
【问题描述】:
我想在背景中,在一个大 div 的两端放置一个图像。
CSS代码:
}
.headall {
background-color: #44546a;
/*width: 100%;*/
/*top: 0 !important;*/
}
.headl {
width: 12%;
float: left;
/*display: table-cell;*/
justify-content: right;
transform: scaleX(-1);
background-image: url(./images/leaves.png);
background-repeat: no-repeat;
background-size: 130px;
}
.headctr {
width: 76%;
display: inline-block;
justify-content: center;
}
.headr {
width: 12%;
float: right;
display: table-cell;
justify-content: right;
background-image: url(./images/leaves.png);
background-repeat: no-repeat;
background-size: 130px;
}
但是,图像不会显示。
将图像放在主文件中,工作,但它把它放在前台....
【问题讨论】:
-
如果您说的是 in main fil working,我想它在主 HTML 文件中。所以也许你必须检查图像上的路径。在这里你有 1 个文件夹,然后是文件夹图像
-
请发送您的 HTML
-
每小时“为什么我的图像不显示?”它总是返回答案“你的路径名是错误的”
标签: css background-image