兩天過去了。但我還沒有找到任何解決方案。 條件是 -圖像自動調整大小與屏幕高度,沒有滾動條 - CSS
1.沒有滾動條(垂直或水平),
2.屏幕高度未知,因此所有內容(圖片和文字)應與屏幕高度自動調整大小,
我的代碼是這裏 -
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Quickstart</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
<!-- Bootstrap fremwork main css -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
#padding{
padding: 15px;
}
img{
width: 100%;
}
</style>
</head>
<body>
<div class="myDiv">
<div class="container">
<div class="row">
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/ccc/fff.jpg" class="img-responsive" alt="">
</div>
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/000/fff.jpg" class="img-responsive" alt="">
</div>
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/ccc/fff.jpg" class="img-responsive" alt="">
</div>
</div>
<div class="row">
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/000/fff.jpg" class="img-responsive" alt="">
</div>
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/ccc/fff.jpg" class="img-responsive" alt="">
</div>
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/000/fff.jpg" class="img-responsive" alt="">
</div>
</div>
<div class="row">
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/ccc/fff.jpg" class="img-responsive" alt="">
</div>
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/000/fff.jpg" class="img-responsive" alt="">
</div>
<div class="col-md-4" id="padding">
<img src="https://dummyimage.com/300x300/ccc/fff.jpg" class="img-responsive" alt="">
</div>
</div>
<div class="row">
<div class="col-md-12"><h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis dignissimosus.</h2></div>
</div>
</div> <!-- end container -->
</div> <!-- end myDiv -->
</body>
</html>
我這個link和嘗試。
由於內容(不是很多內容)大於屏幕高度,因此是否可以調整屏幕高度?
如果您有任何解決方案,建議或任何問題,請寫評論。
謝謝。
我已經試過很多次類似原樣 '{HTML \t高度:100%; } body { height:100%; \t margin:0px; } .myDiv { \t float:left; \t身高:100%; \t寬度:100%; }' –