如果我有文字,div的渐变背景不显示?

时间:2016-11-17 16:51:57

标签: html css webkit gradient

我正在尝试为Enjin网站制作标签(实际上是两个)。我正在尝试使用渐变文本制作渐变,但它不起作用。这是我的代码:

#ownerheaven {
    width: 120px;
    height: 30px;
    background: linear-gradient(#00A6FF, #0033FF);
    border-radius: 60px;
}
#owner_heaven_text {
    font-size: 20px;
    padding: 0;
    margin: 0;
}
<div id="container">
    <div id=" heaven"></div>
        <div id="owner_heaven">
            <h1 id="owner_heaven_text">OWNER</h1>
        </div>
    <div id="dragon">
        <div id="owner_dragon"></div>
    </div>
</div>

提前感谢您的任何帮助:)

1 个答案:

答案 0 :(得分:3)

您在_的CSS中忘记了#owner_heaven

&#13;
&#13;
#owner_heaven {
    width: 120px;
    height: 30px;
    background: linear-gradient(#00A6FF, #0033FF);
    border-radius: 60px;  
}
#owner_heaven_text {
    font-size: 20px;
    padding: 0;
    margin: 0;
}
&#13;
<div id="container">
    <div id=" heaven"></div>
        <div id="owner_heaven">
            <h1 id="owner_heaven_text">OWNER</h1>
        </div>
    <div id="dragon">
        <div id="owner_dragon"></div>
    </div>
</div>
&#13;
&#13;
&#13;