随笔记录方便自己和同路人查阅,学习CSS时最好先学会HTML。
#------------------------------------------------我是可耻的分割线-------------------------------------------
background-repeat:no-repeat;可以让background-image失效,看下面代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div style="background-repeat:no-repeat;background-image:url('4.png');500px;height:500px"></div>
</body>
</html>
效果:
可以看出,虽然还有background-image但是并没有起作用