例子:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Test</title>
<style type="text/css">
body{
margin: 0px;
padding: 5px;
}
.box {
text-align: center;
}
.left {
display: inline-block;
width: 49.5%;
margin-right: 0.5%;
border: 1px solid rgba(127, 127, 127, 0.6);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.right {
display: inline-block;
width: 49.5%;
margin-left: 0.5%;
border: 1px solid rgba(127, 127, 127, 0.6);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="box">
<div class="left">left</div><div class="right">right</div>
</div>
</body>
</html>