Html 回顾

基本页面结构:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
        
    </body>
</html>
Tag    Description
<html>    Defines the root of an HTML document
<body>    Defines the document's body
<head>    A container for all the head elements (title, scripts, styles, meta information, and more)
<h1> to <h6>    Defines HTML headings
<hr>    Defines a thematic change in the content
Tag    Description
<p>    Defines a paragraph
<br>    Inserts a single line break
<pre>    Defines pre-formatted text

1.块元素:

  • Heading: h1-h6 标题
1 Headings Are Important
2 Search engines use the headings to index the structure and content of your web pages.
3 
4 Users skim your pages by its headings. It is important to use headings to show the document structure.
5 
6 <h1> headings should be used for main headings, followed by <h2> headings, then the less important <h3>, and so on.
  • HTML Horizontal Rules 水平标尺
HTML Horizontal Rules
The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.
The <hr> element is used to separate content (or define a change) in an HTML page:
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:

eg:
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Display
You cannot be sure how HTML will be displayed.
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.
The browser will remove any extra spaces and extra lines when the page is displayed:

as follows: (如下图:)

  • The HTML <pre> Element 预格式化文本

    The HTML <pre> element defines preformatted text.
    
    The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:(保留预留空格和换行)
    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>

    as follows:

2.内联元素:

3.表格,表单。

4.HTML5

猜你喜欢

转载自www.cnblogs.com/anwser-jungle/p/9002128.html