還沒有寫完,後續持續更新

首先來熟悉一下html的基本結構

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>標題</title>
</head>
<body>
這裡是文件的主體
<!--這是一行註釋,註釋不會在瀏覽器中顯示!-->
</body>
</html>

寫在前,定義文件型別,大小寫均可。

html標籤:其作用是告知瀏覽器其自身是一個 HTML 文件。

Head標籤:其作用是定義關於文件的資訊。其中的元素可以引用指令碼、指示瀏覽器在哪裡找到樣式表、提供元資訊

頁面編碼

常用的編碼格式有utf-8和gb2312(中文), 在標籤內定義

其目的是告知瀏覽器此頁面屬於什麼字元編碼格式

Title標籤:通常放在瀏覽器視窗的標題欄或狀態列上

Body標籤:定義文件的主體,我們所敲得程式碼主要在這裡面

註釋

例:

<!--這是一行註釋-->

用於換行

特殊字元

> 大於號 (>)

< 小於號 (<)

" 引號 (")

“ 左引號 (")

” 右引號 (")

註冊商標()

註冊商標()

版權()

& and(&)

— 破折線(—)

– 短破折線(–)

£ 英鎊(£)

€ 歐元(€)

¥ 日元(¥)

  佔位符,表示1個空格,直接敲空格無論連續敲多少個,都只顯示一個空格,用 敲幾次就有幾個空格

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>特殊符號</title>
</head> <body>
<p>大於號&gt;</p>
<p>小於號&lt;</p>
<p>引號&quot;</p>
<p>左引號&8220;</p>
<p>右引號&8221;</p>
<p>版權&reg;</p>
<p>註冊商標&8482;</p>
<p>and&amp;</p>
<p>破折線—</p>
<p>短破折線–</p>
<p>英鎊&pound;</p>
<p>歐元€</p>
<p>日元&yen;</p>
<p>十個個空格 直接敲得</p>
<p>十個空格&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用佔位符表示</p>
</body>
</html>

段落標籤

可以利用align來對段落進行左中右對齊。align的值為left, center, right, justify

其中justify是對行進行伸展,這樣每行都可以有相等的長度

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>段落</title>
</head> <body>
<P>這是一個最基本的段落</p>
<P align="left">這是一個左對齊的段落</p>
<P align="right">這是一個右對齊的段落</p>
<P align="center">這是一個居中的段落</p>
<center><P>這是一個用&lt;center&gt;居中的段落</p></center>
<P align="justify">每行都可以有相等的長度</p>
<!--感覺justify好像沒有什麼用,那位大佬可以指點一下-->
</body>
</html>

標題。

標題一共有6級,分別為

~

.

從一級至六級,字型依次減小

例:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>標題</title>
</head> <body>
<h1>這是一級標題</h1>
<h2>這是二級標題</h2>
<h3>這是三級標題</h3>
<h4>這是四級標題</h4>
<h5>這是五級標題</h5>
<h6>這是六級標題</h6>
<!-zhi-->
<p>&nbsp;</p>
</body>
</html>

文字格式

粗體

斜體

字的上標

字的下標

例:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>標題</title>
</head> <body>
<p>
正常<br/>
<strong>粗體</strong><br/>
<em>斜體</em><br/>
x<sup>2</sup><br/>
x<sub>1</sub>
</p>
</body>
</html>

有序列表

type= disc/circle/square
disc 實心圓點
circle 為空心圓
square 正方形

無序列表

Type=1/a/A/i/I
例:
```

視訊

  • pubg
  • Ring of Elysium
  • Cyberpunk 2077
  • lol
  • gta
  • pubg
  • Ring of Elysium
  • Cyberpunk 2077
  • lol
  • gta
  • pubg
  • Ring of Elysium
  • Cyberpunk 2077
  • lol
  • gta
  1. pubg
  2. Ring of Elysium
  3. Cyberpunk 2077
  4. lol
  5. gta
  1. pubg
  2. Ring of Elysium
  3. Cyberpunk 2077
  4. lol
  5. gta
  1. pubg
  2. Ring of Elysium
  3. Cyberpunk 2077
  4. lol
  5. gta
  1. pubg
  2. Ring of Elysium
  3. Cyberpunk 2077
  4. lol
  5. gta
  1. pubg
  2. Ring of Elysium
  3. Cyberpunk 2077
  4. lol
  5. gta

```

超連結

超連結可以是一個字,一個詞,或者一組詞,一幅圖,通過點選這些內容來跳轉到指定的介面,當滑鼠移動到超連結上時,箭頭會變為一隻小手

到達指定網址

撥打指定電話

傳送簡訊到指定號碼

向指定郵箱傳送電子郵件

訪問指定伺服器

訪問指定伺服器

例:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>超連結</title>
</head> <body>
<p>
<a href="https://www.cnblogs.com/yphnb/">歡迎訪問我的部落格</a><br/>
<a href="https://www.cnblogs.com/yphnb/" target="_blank">歡迎訪問我的部落格</a><br/>
<!-- target="_blank"表示在新的視窗開啟這個連結-->
<a href="tel:110">報警電話</a>
<a href="sms: 110">傳送簡訊到指定號碼</a>
<!--資訊電腦好像不能用-->
<a href = "mailto:[email protected]">給我發電子郵件</a>
<a href = "ftp://伺服器IP地址或域名">訪問指定伺服器</a>
<a href = "telnet://伺服器IP地址或域名">訪問指定伺服器</a>
</p>
<!-zhi-->
<p>&nbsp;</p>
</body>
</html>

錨點

#號不能省略!



例:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>錨點</title>
</head> <body>
<center> <p>點選以下按鈕,直達歌詞目錄</p>
<a href="#maodian0">My Heart Will Go On</a><br />
<!--指向指定位置的錨點-->
<a href="#maodian1">Bohemian Rhapsody</a><br />
<a href="#maodian2">Call Me Maybe</a><br /> <a name="maodian0"><h3>My Heart Will Go On</h3></a>
<!--<a name="maodian0"></a>,這是一個錨點,用於定位-->
<p>Every night in my dreams<br>
I see you<br>
I feel you<br>
That is how I know you go on<br>
Far across the distance<br>
And spaces between us.<br>
You have come to show you go on<br>
Near far,<br>
wherever you are<br>
I believe that the heart does go on<br>
Once more,<br>
you open the door,<br>
And you're here in my heart.<br>
And my heart will go on and on<br>
Love can touch us one time.<br>
And last for a lifetime<br>
And never let go till we're gone,<br>
Love was when I loved you<br>
One true time I hold to.<br>
In my life we'll always go on.<br>
Near far,<br>
wherever you are<br>
I believe that the heart does go on<br>
Once more,<br>
you open the door,<br>
And you're here in my heart,<br>
And my heart will go on and on<br>
You're here,<br>
You're here,<br>
there's nothing I fear.<br>
And I know that my heart will go on<br>
we'll stay forever this way.<br>
You are safe in my heart,<br>
and my heart will go on and on</p>
<p>&nbsp;</p>
<p>&nbsp;</p> <a name="maodian1"><h3>Bohemian Rhapsody </h3></a>
<p>Is this the real life</p>
<p>Is this just fantasy</p>
<p>Caught in a landslide</p>
<p>No escape from reality</p>
<p>Open your eyes, look up to the skies and see</p>
<p>I'm just a poor boy, (oooh, poor boy)</p>
<p>I need no sympathy</p>
<p>Because I'm easy come, easy go</p>
<p>Little high, little low</p>
<p>Anyway the wind blows, doesn't really matter to me</p>
<p>To me</p>
<p>Mama, just killed a man</p>
<p>Put a gun against his head</p>
<p>Pulled my trigger now he's dead</p>
<p>Mama, life had just begun</p>
<p>But now I've gone and thrown it all away</p>
<p>Mama, oooh, ooh, ooh, ooh</p>
<p>Didn't mean to make you cry</p>
<p>If I'm not back again this time tomorrow</p>
<p>Carry on, carry on, as if nothing really matters</p>
<p>Too late, my time has come</p>
<p>Sends shivers down my spine</p>
<p>Body's aching all the time</p>
<p>Goodbye everybody, I've got to go</p>
<p>Gotta leave you all behind and face the truth</p>
<p>Mama, oooh, ooh, ooh, ooh</p>
<p>(Anyway the wind blows)</p>
<p>I don't wanna die</p>
<p>I sometimes wish I'd never been born at all</p>
<p>I see a little silhouetto of a man</p>
<p>Scaramouche, Scaramouche will you do the fandango?</p>
<p>Thunderbolts and lightning</p>
<p>Very, very frightening me</p>
<p>Galileo, galileo</p>
<p>Galileo, galileo</p>
<p>Galileo, figaro</p>
<p>Magnifico-o-o-o-oh</p>
<p>I'm just a poor boy, nobody loves me</p>
<p>He's just a poor boy from a poor family</p>
<p>Spare him his life from this monstrosity</p>
<p>Easy come, easy go, will you let me go</p>
<p>Bismillah! No, we will not let you go, let him go</p>
<p>Bismillah! We will not let you go, let him go</p>
<p>Bismillah! We will not let you go, let me go</p>
<p>Will not let you go, let me go</p>
<p>Never, never, never, never let me go-o-o-o-oh (Never let you go)</p>
<p>No, no, no, no, no, no, no</p>
<p>Oh, mama mia, mama mia</p>
<p>Mama mia let me go</p>
<p>Beelzebub has a devil put aside for me, for me, for me</p>
<p>So you think you can stone me and spit in my eye?</p>
<p>So you think you can love me and leave me to die?</p>
<p>Oh, baby, can't do this to me baby</p>
<p>Just gotta get out, just gotta get right outta here</p>
<p>Ooooh, ooooh, ooooh</p>
<p>Oooh yeah, oooh yeah</p>
<p>Nothing really matters</p>
<p>Anyone can see</p>
<p>Nothing really matters</p>
<p>Nothing really matters to me</p>
<p>Anyway the wind blows</p>
<p>Producers : Roy Thomas Baker / Queen</p>
<p>Lead &amp; Backing Vocals : Freddie Mercury</p>
<p>Piano : Freddie Mercury</p>
<p>Electric Guitar : Brian May</p>
<p>Bass Guitar : John Deacon</p>
<p>Drums, Timpani &amp; Gong : Roger Taylor</p>
<p>Operatic Vocals : Freddie Mercury (Middle Register) / Brian May (Low Register) / Roger Taylor (High Register)</p>
<p>Recorded at Rockfield Studio, Roundhouse, Sarm East Studios, Scorpio Sound, and Wessex Sound Studios</p>
<p>&nbsp;</p> <a name="maodian2"><h3>Call Me Maybe</h3></a>
<p>I threw a wish in the well,</p>
<p>Don't ask me, I'll never tell</p>
<p>I looked to you as it fell,</p>
<p>and now you're in my way</p>
<p>I trade my soul for a wish,</p>
<p>pennies and dimes for a kiss</p>
<p>I wasn't looking for this,</p>
<p>but now you're in my way</p>
<p>Your stare was holdin', Ripped jeans, skin was showin'</p>
<p>Hot not, wind was blowin'</p>
<p>Where you think you're going, baby?</p>
<p>Hey, I just met you,</p>
<p>and this is crazy,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>It's hard to look right,</p>
<p>at you baaaabeh,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>Hey, I just met you,</p>
<p>and this is crazy,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>And all the other boys,</p>
<p>try to chaaase me,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>You took your time with the call,</p>
<p>I took no time with the fall</p>
<p>You gave me nothing at all,</p>
<p>but still, you're in my way</p>
<p>I beg, and borrow and steal</p>
<p>Have foresight and it's real</p>
<p>I didn't know I would feel it,</p>
<p>but it's in my way</p>
<p>Your stare was holdin', Ripped jeans, skin was showin'</p>
<p>Hot not, wind was blowin'</p>
<p>Where you think you're going, baby?</p>
<p>Hey, I just met you,</p>
<p>and this is crazy,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>It's hard to look right,</p>
<p>at you baaaabeh,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>Hey, I just met you,</p>
<p>and this is crazy,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>And all the other boys,</p>
<p>try to chaaase me,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>Before you came into my life</p>
<p>I missed you so bad</p>
<p>I missed you so bad</p>
<p>I missed you so, so bad</p>
<p>Before you came into my life</p>
<p>I missed you so bad</p>
<p>And you should know that</p>
<p>I missed you so, so bad</p>
<p>It's hard to look right,</p>
<p>at you baaaabeh,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>Hey, I just met you,</p>
<p>and this is crazy,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>And all the other boys,</p>
<p>try to chaaase me,</p>
<p>but here's my number,</p>
<p>so call me, maybe?</p>
<p>Before you came into my life</p>
<p>I missed you so bad</p>
<p>I missed you so bad</p>
<p>I missed you so so bad</p>
<p>Before you came into my life</p>
<p>I missed you so bad</p>
<p>And you should know that</p>
<p>So call me, maybe?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</center>
</body>
</html>

相對路徑

./ 當前html檔案所在目錄

../ 回到html檔案所在目錄的上一層目錄

muluming/ 進入到html檔案所在目錄的同級目錄muluming

../muluming/ 進入到html檔案所在目錄的上一層的目錄下的muluming

絕對路徑

C:\Users\yupeng\Desktop

影象


例:
```

圖片

Ladygaga

世界上第二帥的頭像



####視訊:
<video src="路徑" autoplay controls loop ></video>

<!doctype html>

視訊

本地視訊

您的瀏覽器不支援

線上視訊

您的瀏覽器不支援

```