html - CSS3 边框和渐变

标签 html css fluid

我有一个 HTML CSS 查询。

我有以下 JS Fiddle。 http://jsfiddle.net/NC9NL/如果你看一下这个 fiddle ,你会看到我在主要内容的两边都有两个 div 来赋予它渐变效果。这两个div left和right设置为100%;

然而,当主要内容比这个大时,例如需要一个滚动条,其他两个 div 不跟随它向下移动页面。有谁知道我怎样才能做到这一点。

干杯,

最佳答案

我认为您并不真的需要那些额外的列。只需将两个渐变合并为一个并将其分配给主列即可:

.container_body {
    background: #fff;
    background: -moz-linear-gradient(left, #c6c6c6 0%, #ffffff 2%, #ffffff 98%, #c6c6c6 100%);
    background: -webkit-gradient(linear, left top, right top, color-stop(0%,#c6c6c6), color-stop(2%,#ffffff), color-stop(98%,#ffffff), color-stop(100%,#c6c6c6));
    background: -webkit-linear-gradient(left, #c6c6c6 0%,#ffffff 2%,#ffffff 98%,#c6c6c6 100%);
    background: -o-linear-gradient(left, #c6c6c6 0%,#ffffff 2%,#ffffff 98%,#c6c6c6 100%);
    background: -ms-linear-gradient(left, #c6c6c6 0%,#ffffff 2%,#ffffff 98%,#c6c6c6 100%);
    background: linear-gradient(to right, #c6c6c6 0%,#ffffff 2%,#ffffff 98%,#c6c6c6 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c6c6c6', endColorstr='#c6c6c6',GradientType=1 );
}

关于html - CSS3 边框和渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12931702/

相关文章:

jquery 在新窗口中打开图像

javascript - 如何在溢出隐藏父元素内显示绝对元素

jquery - 在现有页面上实现流体设计

TYPO3:未找到模板。无法解决 View 的操作

javascript - 如何将 <script> 放在框架集文档的 "body"中?

html - 使用flex-box时如何添加一行作为伪元素

html - 反转 <meta name=robots...> 标记中的属性顺序是否会影响搜索引擎索引?

jquery - Bootstrap轮播宽度比图片大

html - 五柱式装载机

css - 新的 "hidden footer"有效,但仍然与屏幕底部的内容重叠