【发布时间】:2017-11-08 08:51:24
【问题描述】:
我有以下简单的网页。在这里,我使用 vh 作为图像高度。但是当我将其调整为小屏幕尺寸时,背景部分的大小无法正确调整大小。
在不移除 vh 的情况下有没有解决这个问题的方法。
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
section{
background-color: rgb(200,200,200);
padding: 10px 0px 30px 0px;
}
.edit_image img{
max-height: 80vh;
padding: 30px 30px 30px 30px;
}
</style>
</head>
<body>
<div class="container-full" style="padding: 20px;">
<section>
<div class="row">
<div class="col-md-12 col-sm-12 text-center">
<div class='edit_image' img_id=0><img src='http://cdn.wonderfulengineering.com/wp-content/uploads/2016/01/Desktop-Wallpaper-4.jpg'></div>
</div>
</div>
</section>
</div>
</body>
</html>
错误(小屏幕):
正确(普通网页):
【问题讨论】:
标签: css twitter-bootstrap responsive-design