Html 回顾

基本页面结构:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
        
    </body>
</html>
综述:

标签 描述
<html> 定义了 HTML文档的 根 <body> 定义了 HTML文档的 主体 <head> 对于所有头元素的容器:(title, scripts, styles, meta information, and more) <h1> to <h6> 标题 <hr> 定义了文本内容的主题更改线
<p>       定义了段落
<br>      断行
<pre>     预文本

1.块元素:

  • Heading: h1-h6 标题
  • 下面是原文说明,外加翻译。
1 Headings Are Important
标题权重很大
2 Search engines use the headings to index the structure and content of your web pages.  搜索引擎会使用标题去索引化你的网页内容和结构 4 Users skim your pages by its headings. It is important to use headings to show the document structure.   用户会通过标题来略读,所以,标题对于文档结构很重要 5 <h1> headings should be used for main headings, followed by <h2> headings, then the less important <h3>, and so on.
  • HTML Horizontal Rules :hr 水平标尺
HTML Horizontal Rules
1 The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.
  hr 标签定义了HTML页面里的断行主题,主要以水平线方式展现出来。 2 The
<hr> element is used to separate content (or define a change) in an HTML page:
  hr 被用于在网页中分隔内容或者做出改变
examples:
1
<h1>This is heading 1</h1> 2 <p>This is some text.</p> 3 <hr> 4 <h2>This is heading 2</h2> 5 <p>This is some other text.</p> 6 <hr>
  • HTML Paragraphs 段落

The HTML <p> element defines a paragraph:
P 标签定义了一个段落
eg:
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Display:
HTML 展示内容: You cannot be sure how HTML will be displayed.
你无法确定HTML如何展示内容 Large or small screens, and resized windows will create different results.
无论是大屏幕还是小屏幕, 并且调整屏幕大小会导致不同的结果 With HTML, you cannot change the output by adding extra spaces or extra lines in your HTML code.
在HTML里,你无法通过增加一些额外的空格或者空行在你的HTML代码里,然后改变输出样式 The browser will remove any extra spaces and extra lines when the page is displayed:
当页面显示的时候,浏览器会移除掉任何额外的空格和空行
  • The HTML <pre> Element 预格式化文本

1 The HTML <pre> element defines preformatted text.

pre标签定义了预留文本(可以保留空格和换行) 2 The text inside a
<pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:

当文本中有pre标签时, 它会保留空格和换行。
eg:

<pre>
  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.
</pre>

2.内联元素:

3.表格,表单。

4.HTML5

5.HTML-Formating 格式化

HTML Formatting Elements 格式化元素

综述:

1 HTML defines special elements for defining text with a special meaning.
  HTML 定义了一些特别的元素对于一些有特殊意义的文本 2 HTML uses elements like
<b> and <i> for formatting output, like bold or italic text.   HTML 使用 如:b 和 i 标签 来格式化输出, 表示粗体和意大利斜体 3 Formatting elements were designed to display special types of text:   格式化元素主要有以下几种特殊的文本类型: <b> - Bold text <strong> - Important text <i> - Italic text <em> - Emphasized text <mark> - Marked text <small> - Small text <del> - Deleted text <ins> - Inserted text <sub> - Subscript text <sup> - Superscript text

HTML <b> and <strong> Elements

The HTML <b> element defines bold text, without any extra importance.

<b>This text is bold</b>

The HTML <strong> element defines strong text, with added semantic "strong" importance.

<strong>This text is strong</strong>

HTML <i> and <em> Elements

The HTML <i> element defines italic text, without any extra importance.

<i>This text is italic</i>

The HTML <em> element defines emphasized text, with added semantic importance.

<em>This text is emphasized</em>
Note: Browsers display <strong> as <b>, and <em> as <i>. 
However, there is a difference in the meaning of these tags:
  <b> and <i> defines bold and italic text,
  but <strong> and <em> means that the text is "important".

HTML <small> Element

The HTML <small> element defines smaller text:

<h2>HTML <small>Small</small> Formatting</h2>

HTML <mark> Element

The HTML <mark> element defines marked or highlighted text:

<h2>HTML <mark>Marked</mark> Formatting</h2>

HTML <del> Element

The HTML <del> element defines deleted (removed) text.

<p>My favorite color is <del>blue</del> red.</p>

HTML <ins> Element

The HTML <ins> element defines inserted (added) text.

<p>My favorite <ins>color</ins> is red.</p>

HTML <sub> Element

The HTML <sub> element defines subscripted text.

<p>This is <sub>subscripted</sub> text.</p>

HTML <sup> Element

The HTML <sup> element defines superscripted text.

<p>This is <sup>superscripted</sup> text.</p>

BackView:

HTML Text Formatting Elements
Tag    Description
<b>    Defines bold text
<em>    Defines emphasized text 
<i>    Defines italic text
<small>    Defines smaller text
<strong>    Defines important text
<sub>    Defines subscripted text
<sup>    Defines superscripted text
<ins>    Defines inserted text
<del>    Defines deleted text
<mark>    Defines marked/highlighted text
 
原文地址:https://www.cnblogs.com/anwser-jungle/p/9002128.html