我不知道以前是否有人问过这个问题。我正在开发 MVC + 安全应用程序并完成了所有部分,但是显示页面中存在一些小问题,下面是我的 .css 文件的片段
body{
background-color:#D8D8D8;
background-image:url("../css/logo.gif");
background-repeat:no-repeat;
background-position:right top;
margin-right:200px;
margin-left:15px;
}
这是我公司的标志。现在我必须在页面的(位置:右下角)添加另一张图片。任何人都可以建议如何去做吗?还是不可能?
谢谢
最佳答案
background-image
属性可以 accept a comma-separated list of values in CSS3 ,但并非所有浏览器都支持它:
body{
background-color: #D8D8D8;
background-image: url("../css/logo.gif"), url("../css/other-logo.gif");
background-repeat: no-repeat, no-repeat;
background-position: right top, right bottom;
margin-right: 200px;
margin-left: 15px;
}
如果您需要广泛的支持,通常的方法是添加一个额外的包装器元素。
关于html - 使用 CSS 在背景上显示多个图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9465852/