我想在 HTML 文档中添加空间,例如橙色矩形内的空间。我不知道它的专业术语是什么。抱歉。
最佳答案
如果您希望让您的网页居中并且您在主容器上使用固定宽度,这很容易实现。
CSS
.container {
margin:0 auto; /* this will center the page */
width:960px; /* use your width here */
}
HTML
<body>
<div class="container">
<!-- all your great content here -->
</div>
</body>
如果您需要帮助将此应用到您的 html/css,请发布您的 html,我很乐意帮助您。
关于html - 如何使用 HTML/CSS 在网页的左右两侧添加空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12429158/