<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
.box1 { | |
height: 300px; | |
border: 2px solid tomato; | |
background: url(./images/pic3.jpg) no-repeat; | |
/* 响应式背景图片 */ | |
background-size: 100% 100%; | |
background-size: cover; | |
background-size: contain; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="box1"> | |
</div> | |
</body> | |
</html> |
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交