HTML5 web page text foundation

Posted by mr.rum on Thu, 18 Nov 2021 17:13:24 +0100

catalogue

1, Title

         ① Marking of title

         ② Title Alignment

2, Writing

        ① Decoration of words

        ② Superscript and subscript of text

        ③ Special symbols

  3, Paragraph

        ① Paragraph and line breaks

        ② Original format tag

1, Title

         An article needs a summary and summary, so the title is essential.

         ① Marking of title

         There are 6 titles in total, representing the font size of the title from large to small

<h1>My biggest</h1>
<h2>My second</h2>
<h3>Then I'll be the third</h3>
<h4>Ah, I can only be fourth</h4>
<h5>Fifth is OK</h5>
<h6>If you can't win, you won't be found easily</h6>

  Generally speaking, < H1 > will be defaulted as a large font by the browser. It is more appropriate to use < H2 > to set the title in daily use.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title><Hamlet</title>
</head>
<body>
<h1>To be, or not to be,that is the question</h1>
<h5>From the dramatist Shakespeare's tragedy Hamlet</h5>
<h4>This is a monologue and a poem full of thinking significance. Facing the tragic fate and double choice, Hamlet fell into complex thinking and painful struggle. </h4>
<h4>This monologue was after Prince Hamlet found out that his mother and uncle had killed his father and that they had an affair.</h4>
<h4>At this time, he was in pain and doubt. He was full of doubt about life. He felt that living was meaningless and suicide was better. But he was afraid of death. He didn't know whether people would go to hell after death.</h4>
<h4>So in this monologue, he hesitated and thought about "survival or destruction".</h4>
</body>
</html>

         ② Title Alignment

        Generally speaking, our titles are left aligned, but if I want the title to appear in the middle of the page, I need to use the attribute value "align"

<h2 align="center">I stand in the middle</h2>
<h2 align="right">I'm on the right</h2>
<h2 align="left">I'm on the left</h2>

PS: when using webstorm to write align, bgcolor, background and other attributes, it will remind you that they areOf course, you can run it directly without error. Due to the technical update, we can use CCS3 to realize alignment, but now only use HTML5 to understand the basics.

2, Writing

        ① Decoration of words

         Sometimes you can see italics, strikethrough text, and underlined text in web pages. At this time, we can use some tags to implement it.

<em>italics</em>                                 
<u>Underlined</u>
<strike>Delete line</strike>
Example
<h2><em>I don't know why I'm crooked</em></h2>
<h2><u>I have a floor, why</u></h2>
<h2>There are six!!<strike>I don't have any</strike></h2>

 

 

        ② Superscript and subscript of text

        Generally speaking, superscripts and subscripts are used to meet the needs of mathematical formulas

<sub>I'm a subscript mark, and the guy below me is a superscript</sub>
<sup>I'm a superscript, and the guy above me is a subscript</sup>
<h2>Simple calculation<sup>It's simple</sup></h2>
<h3>x<sub>1</sub>+3x<sub>2</sub><sup>2</sup>=20</h3>
<h3>x<sub>1</sub><sup>2</sup>-2x<sub>2</sub><sup>3</sup>=5</h3>

        ③ Special symbols

        Some special symbols in web pages also need to be implemented by code

"    &quot;     Quotation marks
<    &lt;       Left angle bracket
>    &gt;       Right angle bracket
™    &trade;    trademark
♥    &hearts;   Heart shape
     &nbsp;     Space

  Here are just some examples. When you want to use a special character, you can go to Baidu.

<h2 align="center">&hearts;&hearts;&hearts;&nbsp;&nbsp;&hearts;&hearts;&hearts;</h2>
<h2 align="center">&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;</h2>
<h2 align="center">&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;</h2>
<h2 align="center">&hearts;&hearts;&hearts;&hearts;&hearts;&hearts;</h2>
<h2 align="center">&hearts;&hearts;</h2>

  3, Paragraph

        ① Paragraph and line breaks

        Of course, a paragraph must be placed in a paragraph to appear compact and orderly, and line breaks need to be added for typesetting.

<p>Paragraph marker</p>
<br>Newline character
<h1>To be, or not to be,that is the question</h1>
<h5>From the dramatist Shakespeare's tragedy Hamlet</h5>
<p>This is a monologue and a poem full of thinking significance. Facing the tragic fate and double choice, ha<br>
  Mlet fell into complex thinking and painful struggle. This monologue is Prince Hamlet's discovery of his mother and<br>
  Uncle killed his father, and the two had an affair. At this time, he was in pain and doubt,<br>
  He is full of doubts about life, thinks that living is meaningless and suicide is better, but he is afraid of death and doesn't know<br>
  Will people go to hell after death. So in this monologue, he hesitated and thought about "survival or not"<br>
  It's destruction.</p>

  Obviously, the travel distance decreases and becomes more reasonable

        ② Original format tag

        The original format tag can display the content you added on the page as it is

<pre>
content
</pre>
<pre>
    **  **
  **********
    ******
      **
</pre>

 

Topics: Front-end html5