html的基本标签有段落、标题、换行、水平分割线、注释,现一一给出实例。
段落:用<p>和</p>定义。
<html>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>Paragraph elements are defined by the p tag.</p>
</body>
</html>
标题:用<h>和</h>定义。在h后面加上阿拉伯数字可以表示标题显示的大小,比如<h1>、<h2>...另外标题位置属性是align,居中值是"center"。
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h1>This is a heading</h1>
<body>
<h1 align="center">This is heading 1</h1>
<p>The heading above is aligned to the center of this page.</p>
</body>
换行:用单标签<br>定义。可以用它来插入空行。在<br>左右不管有多少个空白符,都将被滤掉。
This <br>is a para<br> graph with line breaks
水平线:用单标签<hr>定义。用于分隔上下文内容。
<html>
<body>
<p>The hr tag defines a horizontal rule:</p>
<hr>
<p>This is a paragraph</p>
<hr>
<p>This is a paragraph</p>
</body>
</html>
注释:在左角括号后跟上一个感叹号定义,即<!>,感叹号后面跟的内容就作为注释。这部分会被浏览器自动忽略,它的作用是解释代码。
<!This is a comment>
This is a comment!