如何更改< hr>的厚度标签 [英] How can I change the thickness of my <hr> tag

查看:149
本文介绍了如何更改< hr>的厚度标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在CSS中更改水平尺(<hr>)的厚度.我知道可以像这样用HTML完成-

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

<hr size="10">

但是我听说已弃用为在此处的MDN 中提到.在CSS中,我尝试使用height:1px,但它不会更改厚度.我希望<hr>行宽为0.5px.

But I hear that this is deprecated as mentioned on MDN here. 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 */
}

或按需内联:

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

更长的解释此处

这篇关于如何更改&lt; hr&gt;的厚度标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆