我想插入这个边距,但我不知道为什么...我希望它像 Twitter或推特图片
我的 CSS:
body {
margin: 40px;
margin-bottom: 50px;
padding: 0;
background-color: #edece9;
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
font-size: 13px;
color: #333;
}
最佳答案
假设页面结构如下:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div id="main">
</div>
</body>
</html>
然后 style.css 应该如下所示:
* {margin:0;}
div#main {
width:800px;
margin:0 auto;
}
关于html - 如何在页面的右侧和左侧插入边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1625253/