HTML <hr> align 属性
标签" href="tag-main.html"><main>
<map>
<mark>
<menu>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<html>
<picture>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<textarea>
< template>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>
HTML <hr> align 属性
实例
左对齐的水平线:
<p>这是一些文本。这是一些文本。这是一些文本。</p>
<hr align="left" width="50%">
<hr align="left" width="50%">
浏览器支持
所有主流浏览器都支持 align 属性。
定义和用法
HTML5 不支持 <hr> align 属性。请使用 CSS 代替。
在 HTML 4.01 中,<hr> 的 align 属性 已废弃。
align 属性规定水平线的对齐方式。
注意:除非 width 属性设置为小于 100%,否则 align 属性不会有任何效果。
兼容性注释
在 HTML 4.01 中,<hr> 的 align 属性已废弃。请使用 CSS 代替。
CSS 语法(IE 和 Opera):<hr style="text-align:right">
CSS 语法(Firefox、Chrome 和 Safari):<hr style="margin-right:0">
CSS 语法(跨浏览器):<hr style="text-align:right;margin-right:0">
在我们的 CSS 教程中,您可以找到更多有关 text-align 属性的细节。
语法
<hr align="left|center|right">
属性值
| 值 | 描述 |
|---|---|
| left | 左对齐水平线。 |
| center | 居中对齐水平线(默认值)。 |
| right | 右对齐水平线。 |
HTML <hr> 标签