1

如何设置 hr 标签的样式?

#footer hr
{
    background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
}

这在 Firefox 中不起作用。我什至尝试过background:,但这没有用。还有其他方法可以使它工作吗?

4

7 回答 7

2

Its working you need to just use hr in div with your css id footer. As like below

<div id="footer">
   <hr />
</div>
于 2013-03-28T04:10:16.187 回答
1

尝试背景:而不是背景图像:

有关 Firefox 中的工作示例,请参见此处:

http://playground.genelocklin.com/gradient-hr/

于 2013-03-28T02:03:18.760 回答
0
    hrshadow {
        height: 12px;
        border: 0;
        box-shadow: inset 0 12px 12px -12px rgba(0,0,0,0.5);
    }

/****************************/


Newhr {
    height: 30px;
    border-style: solid;
    border-color: black;
    border-width: 1px 0 0 0;
    border-radius: 20px;
}
Newhr:before { 
    display: block;
    content: "";
    height: 30px;
    margin-top: -31px;    
    border-style: solid;
    border-color: black;
    border-width: 0 0 1px 0;
    border-radius: 20px;
}
于 2014-04-21T13:08:19.543 回答
0

好吧,你可以尝试像这样制作一个 div:

CSS:
div.hr{
    background-image:url('yourimage.jpg');
    height: 5px;
    width:  400px; /*About the size of the content area that you are putting it in*/
    margin-left: auto;
    margin-right: auto;
}

HTML:
<div id="hr">
</div>

有任何问题吗?

编辑:看看查理的答案,你可以尝试这样的事情:

<div id="footer">
    <hr id="footer" />
</div>

#footer
{
    height:10px;
    background-color: black;
    padding: 0px
}
于 2013-03-28T02:56:58.563 回答
0

您需要指定的高度<hr />

这个

于 2013-03-28T02:11:11.857 回答
0
.myhr {
    border: 0;
    height: 1px;
    background: #333;
    background-image: -webkit-linear-gradient(left, #ccc, #333, #ccc); 
    background-image:    -moz-linear-gradient(left, #ccc, #333, #ccc); 
    background-image:     -ms-linear-gradient(left, #ccc, #333, #ccc); 
    background-image:      -o-linear-gradient(left, #ccc, #333, #ccc); 
}
于 2014-04-21T13:03:32.243 回答
0
    .hrstyle {
        padding: 0;
        border: none;
        border-top: medium double #333;
        color: #333;
        text-align: center;
    }
    .hrstyle:after {
        content: "§";
        display: inline-block;
        position: relative; 
        top: -0.7em;  
        font-size: 1.5em;
        padding: 0 0.25em;
        background: white;
    }


/****dashed line *****/

.dash_hr {
    border: 0;
    border-bottom: 1px dashed #ccc;
    background: #999;
}
于 2014-04-21T13:11:51.690 回答