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

问题描述

设置<hr>标签的宽度时出现问题.我的意思是希望我的<hr>标签显示为全宽的一半,如下图所示:

I've got a problem with setting the width of <hr> tag.. I mean I want my <hr> tag to be displayed half of the full width like this image:

您可以看到<hr>标签位于<h1>标签和段落之间,是屏幕全宽的一半.

As you can see the <hr> tag is between the <h1> tag and paragraph and it's half of screen full width.

我已经搜索过,而我所要做的就是像这样设置<hr>标签:

I have searched and all I got was to setting the <hr> tag like this:

<hr size="30">

但是那是行不通的.那么,您知道如何设置<hr>标签的宽度吗?

But that just does not work. So do you know how to set the width of <hr> tag ?

推荐答案

设置CSS中hr元素的样式属性

Set the style attributes of the hr element in css

hr {
    width:50%;
    margin:0 auto;
}

这篇关于如何调整hr标签的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 01:33