HTML之左右两个div块,当缩小后,第一个的自动铺开,第二个排在第一个下面。
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.style1 {
height: 100px;
width: 49%;
display: inline-block;
border: 1px solid #333;
min-width: 200px;
}
@media screen and (max-width: 800px) {
.style1 {
width: 100%;
}
}
</style>
</head>
<body>
<div class="style1">
<p>block1</p>
</div>
<div class="style1">
<p>block2</p>
</div>
</body>
</html>