这个问题与无语义网格框架(unsemantic.com)有关。
这是我的html:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/unsemantic-grid-responsive-no-ie7.css" />
<style>
div.blue {
background-color: #00f;
}
div.green {
background-color: #0f0;
}
</style>
</head>
<body>
<div class="grid-container">
<div class="grid-30 blue">
30%
</div>
<div class="grid-70 green">
70%
</div>
</div>
</body>
</html>
这是 unsemantinc 的 CSS 部分,用于定义关键方面:
.grid-container:before, .clearfix:before,
.grid-container:after,
.clearfix:after {
content: ".";
display: block;
overflow: hidden;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.grid-container:after, .clearfix:after {
clear: both;
}
.grid-container {
margin-left: auto;
margin-right: auto;
max-width: 1200px;
padding-left: 10px;
padding-right: 10px;
}
.grid-5, .mobile-grid-5, .grid-10, .mobile-grid-10, .grid-15, .mobile-grid-15, .grid-20, .mobile-grid-20, .grid-25, .mobile-grid-25, .grid-30, .mobile-grid-30, .grid-35, .mobile-grid-35, .grid-40, .mobile-grid-40, .grid-45, .mobile-grid-45, .grid-50, .mobile-grid-50, .grid-55, .mobile-grid-55, .grid-60, .mobile-grid-60, .grid-65, .mobile-grid-65, .grid-70, .mobile-grid-70, .grid-75, .mobile-grid-75, .grid-80, .mobile-grid-80, .grid-85, .mobile-grid-85, .grid-90, .mobile-grid-90, .grid-95, .mobile-grid-95, .grid-100, .mobile-grid-100, .grid-33, .mobile-grid-33, .grid-66, .mobile-grid-66 {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding-left: 10px;
padding-right: 10px;
}
.grid-parent {
padding-left: 0;
padding-right: 0;
}
我使用该unsemantic-grid-responsive-no-ie7.css
文件。理论上,这应该并排创建两个 div,一个占 30% 的宽度,另一个占 70% 的宽度。gutter
如果您愿意(根据 Unsemantic 规范),它们之间应该有20 像素或空间。
但是,我似乎无法得到排水沟。div 只是粘在一起。
有什么想法吗?