html - 1 个内容栏和 2 个侧边栏的 CSS 代码

标签 html css

我创建了一个“新手”页面,我想使用 CSS 对其进行样式化,并且在某种程度上我已经做了一些事情。

我希望我的内容显示在中心,同时带有(白色背景)和两个侧边栏(左侧和右侧)color:blue;

对于这个页面:http://blogsoc.org/mail 我在这里编辑代码:blogsoc.org/mail1

像这样(截图):https://dl.dropbox.com/u/46445635/stack%20question%20copy.png

最佳答案

将所有内容放入 #container block 中。

body { background-color: blue; }
#container { margin: 0 auto; width: 989px; background: white; }

margin: 0 auto 使您的 block 垂直居中。

width: 989px 是 1024x768 屏幕的安全区域。

示例 HTML:

<html>
    <head>
        <style>
            body { background-color: blue; }
            #container { margin: 0 auto; width: 989px; background: white; }
        </style>
    </head>
    <body>
        <div id="container">
            <!-- All your current content -->
        </div>
    </body>
</html>

关于html - 1 个内容栏和 2 个侧边栏的 CSS 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11889956/

相关文章:

html - 如何在删除上层 div 时进行转换

jquery - Angular 2 textarea 不接受来自 JQuery 的值

html - CSS访问链接代码。打开的链接留在其他颜色。我的错误在哪里?

css - IE11 使用 svg 作为背景图像失败

javascript - 如何在 slider 容器中安装元素

html - Spring 启动 java.lang.NullPointerException : null

javascript - 使我的网站与 Noscript 兼容

css - Firefox CSS 大纲错误?

html - 可以将多个 BEM 元素应用于 html 元素的类吗?

CSS 子元素继承父级父级的背景 - CSS 中的 iMessage