我如何改变我的< hr>标签

问题描述:

我想改变CSS中我的水平线规则的厚度。我知道它可以在HTML中完成 -

I want to change the thickness of my horizontal rule in CSS. I know it can be done in HTML like so -

<hr size="10">

但我听说这是已弃用。在CSS中,我尝试使用 height:1px ,但它不会改变厚度。我想要< hr> 行为 0.5px

But I hear that this is deprecated. In CSS I tried using height:1px but it does not change the thickness. I want the <hr> line to be 0.5px thick.

我在Ubuntu上使用Firefox 3.6.11

I am using Firefox 3.6.11 on Ubuntu

一致性删除任何边界并使用< hr> 厚度的高度。添加背景颜色将为您的< hr> 设置指定的高度和颜色。

For consistency remove any borders and use the height for the <hr> thickness. Adding a background color will style your <hr> with the height and color specified.

hr {
    border: none;
    height: 1px;
    /* Set the hr color */
    color: #333; /* old IE */
    background-color: #333; /* Modern Browsers */
}

>

Or inline as you have it:

<hr style="height:1px;border:none;color:#333;background-color:#333;" />

更长的解释此处