目錄
HTML 頁面的工作原理
 
HTML作品的不同標籤及其描述
標籤屬性
HTML 的核心屬性
1) 身分證字號
2) 標題
3) Class
4) Style
Conclusion
首頁 web前端 html教學 HTML 是如何運作的?

HTML 是如何運作的?

Sep 04, 2024 pm 04:13 PM
html html5 HTML Tutorial HTML Properties HTML tags

HTML 是一種基於標籤的語言,用於開發網頁; HTML 代表超文本標記語言。超文本是指網頁連結在一起的方式。因此,網頁上可用的連結稱為超文本。它是一種標記語言,標籤告訴瀏覽器如何在其上呈現頁面。 Berners-Lee 在 1991 年底開發了它,但「HTML2.0」是 1995 年發布的第一個標準規範。後來,它的許多 HTML 版本出現了,例如 HTML 4.0;目前,它的最新版本是HTML5.0,在前端網站開發中非常有名。

HTML 頁面的工作原理

讓我們看看 HTML 頁面的工作原理。

<!DOCTYPE html>
<html>
<head>
<title>title tag of html</title>
</head>
<body>
<h1>heading tag of html</h1>
<p>paragraph tag of html<p>
</body>
</html>
登入後複製

此標籤定義文件的類型和 HTML 版本。

上面的標籤包含了完整的 HTML 程式語言文檔,包括由

... 表示的文檔頭。以及由 ... 表示的文件正文標籤。

head 標籤代表文件的標題,可以保留其他 HTML 標籤,如

、<link> 等。等等 <h4></h4> <p>此標籤在 </p> 內部使用標籤來寫入文件標題。 <h4></h4> <p>標籤代表文件的主體,其中保留其他 HTML 標籤,如 </p> <div>、<h1 id="">、</h1> <p> 等。等等</p> <h3 id="HTML作品的不同標籤及其描述">HTML作品的不同標籤及其描述</h3> <p>HTML 運作原理的不同標籤解釋如下:</p> <h4><h1></h1></h4> <p>標題標籤用於建立下面給出的標題範例的變體</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><!DOCTYPE html> <html> <head> <title>Heading Example</title> </head> <body> <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> </body> </html></pre><div class="contentsignin">登入後複製</div></div> <p><strong>輸出</strong></p> <p>標題 1<br> 標題 2<br> 標題 3<br> 標題 4<br> 標題 5<br> 標題 6</p> <h4></h4> <p> </p> <p>這是一個段落標籤,透過下面給出的範例可以更好地理解。 </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><!DOCTYPE html> <html> <head> <title>Paragraph Example</title> </head> <body> <p>This is a first paragraph of text.</p> <p>This is a second paragraph of text.</p> <p>This is a third paragraph of text.</p> </body> </html></pre><div class="contentsignin">登入後複製</div></div> <p><strong>輸出</strong></p> <p>這是正文的第一段。 <br> 這是正文的第二段。 <br> 這是正文的第三段。 </p> <h4><br></h4> <p>該標籤用於斷行;當我們想要任何東西從下一行開始時,我們可以使用這個標籤。它是一個單行標記,不需要結束標記。 </p> <h4></h4> <p>將整個內容放在中心位置,這是該標籤在網頁創建中的主要用途。 </p> <h4><hr></h4> <p>用於建立線條,主要用於繪製單線網頁時。 </p> <h4></h4> <p>這是HTML非常重要的標籤;在某些情況下,我們希望顯示的所有內容與 HTML 頁面中編寫的內容相同;在這些情況下,它是一個非常有用的標籤。下面給出了一個範例。 </p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><!DOCTYPE html> <html> <head> <title>Preserve Formatting Example</title> </head> <body> <pre class="brush:php;toolbar:false"> Laravel is the PHP framework. It is an open source framework used in web application development. This framework is based on model view controller design pattern due to this project developed with help of this framework are more structured and manageable.  This framework reuses the existing </pre> </body> </html></pre><div class="contentsignin">登入後複製</div></div> <p><strong>輸出</strong></p> <p>Laravel 是 PHP 框架。它是一個用於網路的開源框架<br> 應用程式開發。該框架基於模型視圖控制器<br> 在這個框架的幫助下開發的這個專案的設計模式是<br> 更加結構化和易於管理。  此框架重複使用了現有的</p> <h4 id=""> </h4> <p>要列印單一空格,這在 HTML 中使用。 </p> <h4 id="標籤屬性">標籤屬性</h4> <p>我們可以在標籤層級設定屬性,範例如下</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><!DOCTYPE html> <html> <head> <title>Align Attribute</title> </head> <body> <p align = "left">Left aligned</p> <p align = "center">Center aligned</p> <p align = "right">Right aligned</p> </body> </html></pre><div class="contentsignin">登入後複製</div></div> <p><strong>輸出</strong></p> <p>左對齊<br> 居中對齊<br> 右對齊</p> <h3 id="HTML-的核心屬性">HTML 的核心屬性</h3> <p>有幾個核心屬性已與下面的幾乎所有 HTML 元素一起使用。 </p> <ul> <li>身分證</li> <li>標題</li> <li>班級</li> <li>類型</li> </ul> <h4 id="身分證字號">1) 身分證字號</h4> <p>該屬性用於唯一標識頁面中的HTML元素;同一元素可能已在HTML 頁面中的多個位置使用,透過id 屬性我們可以識別該元素及其內容,並且可以在javascript 中用於其他目的。下面給出了一個範例。 </p> <p><code><p id="html">這是第一段,解釋什麼是 HTML,如何使用它</p> <code><p id = "html">This is first paragraph which  explains what is HTML  how to use it</p><br> <p id = "css">This it second para which  explains what is Cascading Style Sheet and how to use it</p> </code> <p id="css">這是第二段,解釋什麼是級聯樣式表以及如何使用它</p> </code></p> <p>說明 – 在上面的範例中,同一個元素使用了兩次,僅透過 ID 來區分該元素。 </p> <h4 id="標題">2) 標題</h4> <p>此屬性語法類似於 id 屬性,此屬性的用途取決於攜帶它的元素;雖然當遊標移到元素上時它通常顯示為工具提示,但這是該屬性的主要用途。下面給出了範例 –</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><!DOCTYPE html> <html> <head> <title> title Attribute Example</title> </head> <body> <h3 title = "Hello Title Example Test">Sleeping from the long time</h3> </body> </html></pre><div class="contentsignin">登入後複製</div></div> <p><strong>輸出</strong></p> <p>睡了好久</p> <p>If we try to bring our cursor over “Sleeping from a long time”, we will see that whatever title we have used in our code is coming out as a tooltip of the cursor.</p> <h4 id="Class">3) Class</h4> <p>The class attribute is used to associate an element with a style sheet and specifies the class of element. We will learn more about the use of the class attribute when we will learn Cascading Style Sheet (CSS).Its main use is CSS. Value for this attribute may also be a space-separated list of class names. The example is given below –</p> <p><code>class = "className11 className12 className53"</code></p> <h4 id="Style">4) Style</h4> <p>It is used to writing the cascading style rule at the element level, which can be better explained by the example given below.</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><!DOCTYPE html> <html> <head> <title>The style Attribute</title> </head> <body> <p style = "font-family:arial; color:#FF0000;">This is style example text , it is red color...</p> </body> </html></pre><div class="contentsignin">登入後複製</div></div> <p><strong>Output</strong></p> <p>This is a style example text; it is red color…</p> <h3 id="Conclusion">Conclusion</h3> <p>As we saw many basics tags, the web page can be created with the help of these tags, which can be displayed to the end-user whenever a user requests the particular web page through his web browser, the work of displaying will be done by the web browser. Today lots of new tags exist into the market to make web pages more attractive.</p> </div>

以上是HTML 是如何運作的?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1662
14
CakePHP 教程
1418
52
Laravel 教程
1311
25
PHP教程
1261
29
C# 教程
1234
24
HTML 中的表格邊框 HTML 中的表格邊框 Sep 04, 2024 pm 04:49 PM

HTML 表格邊框指南。在這裡,我們以 HTML 中的表格邊框為例,討論定義表格邊框的多種方法。

HTML 中的巢狀表 HTML 中的巢狀表 Sep 04, 2024 pm 04:49 PM

這是 HTML 中巢狀表的指南。這裡我們討論如何在表中建立表格以及對應的範例。

HTML 左邊距 HTML 左邊距 Sep 04, 2024 pm 04:48 PM

HTML 左邊距指南。在這裡,我們討論 HTML margin-left 的簡要概述及其範例及其程式碼實作。

HTML 表格佈局 HTML 表格佈局 Sep 04, 2024 pm 04:54 PM

HTML 表格佈局指南。在這裡,我們詳細討論 HTML 表格佈局的值以及範例和輸出。

HTML 輸入佔位符 HTML 輸入佔位符 Sep 04, 2024 pm 04:54 PM

HTML 輸入佔位符指南。在這裡,我們討論 HTML 輸入佔位符的範例以及程式碼和輸出。

您如何在PHP中解析和處理HTML/XML? 您如何在PHP中解析和處理HTML/XML? Feb 07, 2025 am 11:57 AM

本教程演示瞭如何使用PHP有效地處理XML文檔。 XML(可擴展的標記語言)是一種用於人類可讀性和機器解析的多功能文本標記語言。它通常用於數據存儲

HTML 有序列表 HTML 有序列表 Sep 04, 2024 pm 04:43 PM

HTML 有序列表指南。在這裡我們也分別討論了 HTML 有序列表和類型的介紹以及它們的範例

HTML onclick 按鈕 HTML onclick 按鈕 Sep 04, 2024 pm 04:49 PM

HTML onclick 按鈕指南。這裡我們分別討論它們的介紹、工作原理、範例以及各個事件中的onclick事件。

See all articles