我在理解css響應式設計方面遇到了很多麻煩......我一直在搜索和觀看視頻,但仍然沒有完全理解這樣做的方式。div不會響應瀏覽
這是我的代碼:
<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
h1 {
text-align: center;
}
.wrapper {
width: 900px;
margin: 0 auto;
background: red;
}
.city {
float: left;
margin: 5px;
padding: 10px;
width: 20%;
height: 300px;
border: 1px solid black;
background-color: orange;
}
</style>
</head>
<body>
<h1>Asaf</h1>
<h2>Asaf</h2>
<br>
<div class="wrapper">
<div class="city">
<h2>London</h2>
<p>London is the capital city of England.</p>
<p>It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
</div>
<div class="city">
<h2>Paris</h2>
<p>Paris is the capital and most populous city of France.</p>
</div>
<div class="city">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area, and the most populous metropolitan area in the world.</p>
</div>
<div class="city">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area, and the most populous metropolitan area in the world.</p>
</div>
<div class="city">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area, and the most populous metropolitan area in the world.</p>
</div>
<div class="city">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area, and the most populous metropolitan area in the world.</p>
</div>
</div>
</body>
</html>
爲什麼是div
不響應,並獲得更小的?
也文本是失控的div和越來越複雜了.. – Gsa 2015-02-09 01:36:27