为什么加上在background 后加上 center背景图就不显示啦?
来源:4-3 编程练习
慕莱坞8202083
2019-05-19 23:23:36
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>123</title> <style type="text/css"> *{padding:0px; margin:0px; } .main{ width:100%; height:2000px; background: url(http://climg.mukewang.com/59c9f7ce0001839219034033.png) top left no-repeat center ; background-size:%; </style> </head> <body> <div class="main"> </div> </body> </html>
1回答
好帮手慕码
2019-05-20
同学你好!
因为在之前已经设置过top,left啦,在写一个center相当于给background-position设置了三个值会冲突
它的取值可参考:
举个例子。给同一个div连着设置两个颜色也是不生效的。
祝学习愉快,望采纳~
相似问题