我希望我的3个孩子的div垂直拉伸100%,我希望它们水平相邻。因此,如果我调整父div的大小,子div将相应地调整大小,但是它将始终保持水平相邻(每个占用大约33%的宽度)
所以这是CSS:
.appcontent {
position: absolute;
left: 80px;
right: 50px;
top: 30px;
max-width: 1050px;
min-height: 400px;
border: 2px solid black;
}
.box {
display: inline-block;
height: 98%;
padding: 10px;
border: 2px solid black;
}
和HTML:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery demo</title>
<script src="jquery.js"></script>
<script src="index.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="appcontent">
<div class="box">
<h3>App 1</h3>
</div>
<div class="box">
<h3>App 2</h3>
</div>
<div class="box">
<h3>App 3</h3>
</div>
</div>
</body>
</html>
以防万一我也把它放在http://jsfiddle.net/naWsh/