960网格 - 删除边距左边距和边距右边距

时间:2016-07-29 11:48:32

标签: html css 960.gs

我学习了960 Grid CSS Framework,我在下面有一个HTML代码和CSS:

- HTML代码:

@import url( 'css/reset.css' );
@import url( 'css/text.css' );
@import url( 'css/960.css' );

#wrapper {
	width: 100%;
}
#wp_head,
#wp_foot {
	background-color: #e8e8e8;
}
#header,
#footer {
	border:1px dotted #333;
	min-height: 100px;
}
#content {
	border: 1px dotted #333;
	min-height: 500px;
}
#row-1 {
	
}
.row-1-left{
	border: 1px dotted #333;
	background-color: pink;
	min-height: 50px;
}
.row-1-center {
	border: 1px dotted #333;
	background-color: yellow;
	min-height: 50px;
}
.row-1-right{
	border: 1px dotted #333;
	background-color: lime;
	min-height: 50px;
}
<!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8" />
    		<title>Learn 960 grid</title>
    		<link rel="stylesheet" type="text/css" href="style.css" />
    	</head>
    	<body>
    		<div id="wrapper">
    			<div id="wp_head">
    				<div id="header" class="container_12">Header</div>
    			</div>
    			<div id="row-1" class="container_12 clearfix">
    				<div class="row-1-left grid_4">Left - 4</div>
    				<div class="row-1-center grid_4">Center - 4</div>
    				<div class="row-1-right grid_4">Right - 4</div>
    			</div>
    			<div id="wp_foot">
    				<div id="footer" class="container_12">Footer</div>
    			</div>
    		</div>
    	</body>
    </html>

然后,在下方显示结果(参见图片附件):

enter image description here

问题:我想删除margin-left和margin-right。请帮帮我!

1 个答案:

答案 0 :(得分:0)

你可以这样做:

body {margin: 0;}

这是一个小提琴:https://jsfiddle.net/cpu5syg1/