【发布时间】:2013-05-18 08:35:55
【问题描述】:
在 .CSS 文件中:
当我申请时
body {
font-size: .85em;
font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
color: #232323;
background-color: #fff;
background: url('Images/Login_Background.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-color: #FFFFFF;
background-position: center center;
background-size: 100% 100%;}
background-image:url('Images/Login_Background.jpg'); 工作正常
但只要我创建一个像这样的 id:
#login {
background: url('Images/Login_Background.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-color: #FFFFFF;
background-position: center center;
background-size: 100px 100px;}
当我的<section id="login"> 使用这个css id 时; background: url('Images/Login_Background.jpg'); 样式不起作用!!!
我是不是在我无法发现的地方出错了?累死了!!!
【问题讨论】:
-
发布您的 HTML,您是否在元素上调用该 id?
-
请提供minimal reproducible example,以便我们查看拼图中的所有部分。
标签: html css background-image relative-path