HTML基本标签是什么
HTML基本标签是什么?
工具/原料
HTML
HTML中最重要的标签是定义标题元素,段落和换行的标签。
1、标题元素标题元素由标签<h1>到<h6>定义。<h1>定义了最大的标题元素,<h6>定义了最小的。<h1>This is a heading</h1><h2>This is a heading</h2><h3>This is a heading</h3><h4>This is a heading</h4><h5>This is a heading</h5><h6>This is a heading</h6>HTML自动在一个标题元素前后各添加一个空行。

3、换行当需要结束一行,并且不想开始新段落时,使用<br>标签。<br>标签不管放在什么位置,都能够强制换行。<p>This <br> is a para<br>graph with line breaks</p><br>标签是一个空标签,它没有结束标记。

5、基本注意点——有用的技颢属装嗟巧当你写下HTML文本的时候,你不能确知在另外一个浏览器中,这些文本将被如何显示。有人用着大的显示器,有的人用的小一些。每次用户调整窗口大小的时候,文本都瓴烊椹舟将被重新格式化。不要想在编辑器中写一些空行和空格来协助排版。HTML将截掉你文本中的多余空格。不管多少个空格,处理起来只当一个。一点附加信息:在HTML里面,一个空行也只被当作一个空格来处理。使用空段落<p>来插入空白行是一个坏习惯,请使用<br>标签来替代。(但是不要用<br>标签来创建列表,我们后面会专门学习HTML列表的。)你也许注意到了段落可以不写结束标记</p>。别依赖它,HTML的下一个版本将不准你漏掉任何一个结束标签。HTML自动在某些元素前后增加额外的空行,就像在段落和标题元素的前后一样。我们使用了水平线(<hr>标签)来分隔我们教程的章节。

6、更多示例:多个段落:<html> <body> <p> This paragrap茑霁酌绡h contains a lot of lines in the source code, but the browser ignores it. </p> <p> This paragraph contains a lot of spaces in the source code, but the browser ignores it. </p> <p> The number of lines in a paragraph depends on the size of your browser window. If you resize the browser window, the number of lines in this paragraph will change. </p> </body> </html>这个例子说明了段落的一些默认行为。换行:<html> <body> <p> To break<br>lines<br>in a<br>paragraph,<br>use the br tag. </p> </body> </html>这个例子说明了在HTML文档中换行的使用。诗歌的问题:<html><body><p> My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the ocean. Oh, bring back my Bonnie to me. </p><p>Note that your browser simply ignores your formatting!</p></body></html>这个例子说明了HTML显示格式的一些问题。标题元素:<html><body><h1>This is heading 1</h1><h2>This is heading 2</h2><h3>This is heading 3</h3><h4>This is heading 4</h4><h5>This is heading 5</h5><h6>This is heading 6</h6><p>Use heading tags only for headings. Don't use them just to make something bold. Use other tags for that.</p></body></html>这个例子说明了在HTML中显示标题元素的标签

8、水平线:<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><hr> <p>This is a paragraph</p></body></html>这个例子说明了如何插入水平线。
