html - 使用 CSS3 的线性渐变 div

标签 html css linear-gradients

请帮助我如何使用如下图像路径中的 css 制作 div。

Capture12.jpg

这是我到目前为止的代码... http://jsfiddle.net/L8FfE/

<table class="screenheader" cellspacing="0" cellpadding="0" width="100%" style="padding-top: 5px;">
    <tr style="font-family: Calibri, Arial, Sans-Serif; font-size: 40pt; font-weight: bold;
    color: #fff; background: repeating-linear-gradient(180deg, #23538A , #A7CFDF 5px, #23538A  5px, #A7CFDF 10px);">
        <td width="100%" style="padding-bottom: 5px;">
            <div id="meetingname" width="100%" style="padding-left: 20px; text-align: left;">
                HI Test
            </div>
        </td>
        <td width="100%" style="padding-left: 20px; text-align: left;">
        </td>
    </tr>
</table>

最佳答案

这就是你的意思吗(除了颜色,我没听懂)?
http://jsfiddle.net/L8FfE/2/

HTML:

<div id="background">
    <div id="overlay"></div>
</div>

CSS:

div#background {
    width: 100%;
    height: 50px;
    background: -webkit-gradient(linear, 0 0, 0 100%, from(#053F63), to(#105C97));
    background: -webkit-linear-gradient(#053F63 0%, #105C97 100%);
    background: -moz-linear-gradient(#053F63 0%, #105C97 100%);
    background: -o-linear-gradient(#053F63 0%, #105C97 100%);
    background: linear-gradient(#053F63 0%, #105C97 100%);
}
div#overlay {
    font-family: Calibri, Arial, Sans-Serif;
    font-size: 40pt;
    font-weight: bold;
    color: #fff;
    width: 100%;
    height: 50px;
    background:    -moz-repeating-linear-gradient(rgba(35, 83, 138, 1) 5px, rgba(167, 207, 223, 0) 5px, rgba(35, 83, 138, 1) 5px, rgba(167, 207, 223, 0) 10px);
    background: -webkit-repeating-linear-gradient(rgba(35, 83, 138, 1) 5px, rgba(167, 207, 223, 0) 5px, rgba(35, 83, 138, 1) 5px, rgba(167, 207, 223, 0) 10px);
    background:         repeating-linear-gradient(rgba(35, 83, 138, 1) 5px, rgba(167, 207, 223, 0) 5px, rgba(35, 83, 138, 1) 5px, rgba(167, 207, 223, 0) 10px);
    -webkit-mask-image: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(0, 0, 0, 0)), color-stop(0.4, rgba(0, 0, 0, 0)), color-stop(0.6, rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 1)));
    -webkit-mask-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 1) 100%);
            mask-image:    -moz-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 1) 100%);
            mask-image:      -o-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 1) 100%);
            mask-image:         linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 1) 100%);
}

关于html - 使用 CSS3 的线性渐变 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15409219/

相关文章:

jquery - 我们如何使用 jquery 添加自定义 css?

html - 元素无意中随着内容的变化而移动

html - 使用 input-group 和 input-group-addon Bootstrap 文本格式

html - 下拉菜单不覆盖下面的文本/z-index

javascript - 溢出 : auto on html, body 中断 jQuery .animate 滚动到顶部?

javascript - 滚动时将对象置于屏幕中心

html - 在具有渐变背景的元素上应用透明边框时出现奇怪的效果

html - 没有出现 CSS 渐变

html - 图像拒绝覆盖 div 中的另一个图像

html - div 元素的顶部和底部淡入淡出