多语言展示
当前在线:1259今日阅读:167今日分享:27

HTML基本标签是什么?

HTML基本标签是什么?
工具/原料

HTML

HTML中最重要的标签是定义标题元素,段落和换行的标签。
1

标题元素标题元素由标签

定义。

定义了最大的标题元素,

定义了最小的。

This is a heading

This is a heading

This is a heading

This is a heading

This is a heading
This is a heading
HTML自动在一个标题元素前后各添加一个空行。

2

段落段落是用

标签定义的。

This is another paragraph

HTML自动在一个段落前后各添加一个空行。

3

换行当需要结束一行,并且不想开始新段落时,使用
标签。
标签不管放在什么位置,都能够强制换行。

This
is a para
graph with line breaks


标签是一个空标签,它没有结束标记。

4

HTML中的注释注释标签用来在HTML源文件中插入注释。注释会被浏览器忽略。你可以使用注释来解释你的代码,这可以在你以后编辑代码的时候帮助你。注意:你需要在左括号“<”后面跟一个感叹号,右括号不用。

5

基本注意点——有用的技巧当你写下HTML文本的时候,你不能确知在另外一个浏览器中,这些文本将被如何显示。有人用着大的显示器,有的人用的小一些。每次用户调整窗口大小的时候,文本都将被重新格式化。不要想在编辑器中写一些空行和空格来协助排版。HTML将截掉你文本中的多余空格。不管多少个空格,处理起来只当一个。一点附加信息:在HTML里面,一个空行也只被当作一个空格来处理。使用空段落

来插入空白行是一个坏习惯,请使用
标签来替代。(但是不要用
标签来创建列表,我们后面会专门学习HTML列表的。)你也许注意到了段落可以不写结束标记

。别依赖它,HTML的下一个版本将不准你漏掉任何一个结束标签。HTML自动在某些元素前后增加额外的空行,就像在段落和标题元素的前后一样。我们使用了水平线(
标签)来分隔我们教程的章节。

6

更多示例:多个段落:

This paragraph contains a lot of lines in the source code, but the browser ignores it.

This paragraph contains      a lot of spaces in the source     code, but the    browser ignores it.

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.

这个例子说明了段落的一些默认行为。换行:

To break
lines
in a
paragraph,
use the br tag.

这个例子说明了在HTML文档中换行的使用。诗歌的问题:  

  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.

 

Note that your browser simply ignores your formatting!

  这个例子说明了HTML显示格式的一些问题。标题元素:  

This is heading 1

 

This is heading 2

 

This is heading 3

 

This is heading 4

 
This is heading 5
 
This is heading 6
 

Use heading tags only for headings. Don't use them just to make something bold. Use other tags for that.

  这个例子说明了在HTML中显示标题元素的标签

7

居中的标题元素:  

This is heading 1

 

The heading above is aligned to the center of this page. The heading above is aligned to the center of this page. The heading above is aligned to the center of this page.

  这个例子显示了一个居中的标题元素。

8

水平线:  

The hr tag defines a horizontal rule:

 

This is a paragraph

 

This is a paragraph

 

This is a paragraph

  这个例子说明了如何插入水平线。

9

隐藏的注释:   

This is a regular paragraph

  这个例子说明了在HTML文档中如何插入隐藏的注释。

10

背景色:  

Look: Colored Background!

  这个例子说明了如何给页面设置背景色。

注意事项

感谢您的支持,如果帮助到您,亲请您投上宝贵的一票并加关注也算是您对我分享的一种认可吧。

推荐信息