背景图片在大屏幕上不显示为全图,但适合小屏幕。
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8" dir="ltr" />
<title></title>
<style>
body, html {
height: 100%;
margin: 0;
}
.bgImage {
/* The image used */
background: url(../../../Content/imgs/common/myimage.png) no-repeat center ;
height: 100%;
background-size: cover;
}
</style>
</head>
<body>
<div class="bgImage">
</div>
</body>
</html>
是否有特定尺寸的图像可以在所有屏幕上都具有响应性?
答案 0 :(得分:0)
尝试添加 background-position:center
background-attachment:fixed
到您的 bgimage 类