html - 页面内容居中,边距

标签 html css

如果我想让内容在我的页面上居中,我可以简单地对其应用margin: 0 auto

但这使得利润为零。如果我想要至少在左右两边留出几个 em 的边距,我该怎么做。

谢谢

最佳答案

用边距将内容包裹在 div 中。

关于html - 页面内容居中,边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13160650/

相关文章:

html - 悬停在底部的三 Angular 形带边框

html - 什么是::content/::slotted 伪元素,它是如何工作的?

css - 桌面尺寸移动风格的主菜单

Javascript:为 IE9 加载不同的样式表

html - 如何在 Materialise CSS 中制作 7 列网格?

jquery - 过渡结束后粘糊糊的效果搞砸了

html - 将文本固定到页脚

html - 使用具有当前状态的图像和 CSS 的导航栏

jquery - 同时通过 jquery 发布两个输入数组

html - 内联 block DIV 外显示的文本?