html - 正文和背景部分使用 CSS 分开

标签 html css background

如何使用 CSS 将网站的正文/内容区域与背景分开。为了向您展示我的意思,请看附图。因此,两侧的背景将扩展到拥有超大显示器的人,但内容将始终保持相同大小。

谢谢, 阿马尔

http://i.imgur.com/2AYnU.jpg

最佳答案

试试这个。

body {
  background: #000;
  padding: 50px;
}

#content {
  width: 960px;
  background: #fff;
}

关于html - 正文和背景部分使用 CSS 分开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8157749/

相关文章:

jquery - Bootstrap 3 : Responsive Table with Floating Header

html - 导航栏右侧的 ionic 对齐图标

java - 在后台发送电子邮件

android - 更改 View 的背景颜色?

html - Chrome : Parts of outline on links remain after focus removed (when outline-style is explicitly to "auto")

html - 有没有办法获取 Facebook 的位置更新并将其镜像到另一个网站?

javascript - 如何使用 jquery 在旧的之上添加更多边距?

html - 在 org-mode 中,如何为 HTML 导出插入当前日期?

html - inline-block 对 css 意味着什么?

ruby-on-rails - 使用Capistrano启动后台任务