HTML代码CSS调整块,使其充满空隙
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="monstyle.css" />
</head>
<body>
<section id="section1">
</section>
<section id="section2">
</section>
</body>
</html>
CSS代码
#section1 {
height: 300px;
width: 50%;
min-width: 400px;
background-color: blue;
display: inline-block;
}
#section2 {
height:100px;
width: 40;
min-width: 400px;
background-color: red;
display: inline-block;
}
我的问题是有没有一个 “纯CSS” 的方式,使确定当将屏幕缩小到800像素以下时,“section2”的宽度将增加到适合屏幕的程度? 如果是,如何?
' “第2节” 的宽度将增加“ - 你可能意味着“减少”? – nicael
你的意思是身高:100%? –
是的,可以的,第一部分使用float:left和2nd set margin-left:<第一部分的宽度>。这应该解决您的问题 – Manivannan