Home  >  Article  >  Web Front-end  >  How to set hr centered in css

How to set hr centered in css

WBOY
WBOYOriginal
2021-11-19 19:22:176917browse

In CSS, you can use the "text-align" attribute to set the hr center. The function of this attribute is to specify the horizontal alignment of the element. You only need to add the "text-align:center;" style to the hr element. Can.

How to set hr centered in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to set hr centered in css

In css, you can use the "text-align:center;" attribute to set hr centered,

The text-align attribute specifies the horizontal alignment of text in an element.

This attribute sets the horizontal alignment of text within block-level elements by specifying the point at which the line box is aligned. The value justify is supported by allowing user agents to adjust the spacing between letters and words in line content; different user agents may get different results.

The example is as follows:




    
    
    
    Document

HTML

HTML 是用于描述 web 页面的一种语言。


CSS

CSS 定义如何显示 HTML 元素。

Output result:

How to set hr centered in css

(Learning video sharing: css video tutorial)

The above is the detailed content of How to set hr centered in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn