目錄
HTML5 語意範例
範例 #3 –
範例 #4 – 
如何在一個範例中實作所有元素程式碼?
首頁 web前端 html教學 HTML5 語意

HTML5 語意

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

HTML5 語意元素具有反映組件類型的重要名稱。讓我們以表格、頁首、頁尾等為例

  • 對於 HTML4,開發人員使用自己的 id/類別名稱來設計元素,例如頂部、頁首、底部、選單、頁尾、主要、導覽、材質、物件、頂部導覽、側邊欄等。然而,正因為如此,搜尋引擎無法辨識網頁的正確內容。

    HTML5 語意範例

    現在讓我們來看一些 HTML5 語意元素的範例:

    範例 #1 –

    顧名思義,它指的是頁面介紹段的標題。一頁上可以找到許多標題。

    代碼:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Header Element for the page</title>
    <style>
    h1, h4 {
    Color:#red;
    Text-align:centre;
    margin-bottom:2px;
    }
    p {
    font-size:23px;
    text-align:centre;
    margin-top:2px;
    }
    </style>
    </head>
    <body>
    <article>
    <header>
    <h1>Educba learning bridge</h1>
    <h3>Become a techinal learner with EDUCBA</h3>
    <p>Hey the best online training institute in ASIA </p>
    </header>
    </article>
    </body>
    </html>
    登入後複製

    輸出:

    HTML5 語意

    範例 #2 –

    導覽連結的集合,用於描述導覽功能表或導覽列。

    代碼:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Navigation Element</title>
    <style>
    h1 {
    color:#Grey;
    }
    </style>
    </head>
    <body>
    <h1>Navigation Bar for EduCBA</h1>
    <nav>
    <a href="https://www.educba.com/">Home</a> |
    <a href="https://www.educba.com/data-science/">Data Science</a> |
    <a href="https://www.educba.com/software-development/">Software Development</a> |
    <a href="https://www.educba.com/design/">Design</a> |
    <a href="https://www.educba.com/finance/">Finance</a>
    </nav>
    </body>
    </html>
    登入後複製

    輸出:

    HTML5 語意

    範例 #3 –

    頁面可以分為簡介、聯絡方式、詳細資訊等部分,每個部分都有一個元素。

    代碼:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Have a look for Section Element in EduCBA</title>
    <style>
    h1 {
    color:#Grey;
    }
    p {
    font-size:20px;
    text-align:left;
    margin-top:2px;
    }
    </style>
    </head>
    <body>
    <section>
    <h1>AWS Tutorials for EduCBA</h1>
    <p>Amazon Web Services (AWS) is one of the world's most popular and used cloud services. 175 supported services are available in AWS. </p>
    </section>
    <section>
    <h1>Data Mining</h1>
    <p>AThrough technological development such as big data and data science companies around the world have benefited from data mining by recognize opportunities and making their organizations efficient through waste reduction, to achieve their business goals.
    </p>
    </section>
    </body>
    </html>
    登入後複製

    輸出:

    HTML5 語意

    範例 #4 – 

    此標記元素用於突出顯示文字。

    代碼:

    <!DOCTYPE html>
    <html>
    <head>
    <title>EduCBA mark Element</title>
    <style>
    h2 {
    color:#Grey;
    }
    </style>
    </head>
    <body>
    <h1>How to mark text </h1>
    <p> In theory, this method transforms <mark>raw data into valuable information</mark> or insights.</p>
    </body>
    </html>
    登入後複製

    輸出:

    HTML5 語意

    範例 #5 –

    它是區塊或段劃分的一個面向。它被用作一個包。

    代碼:

    <!DOCTYPE html>
    <html>
    <head>
    <title>div Element</title>
    <style>
    .edu {
    color:#grey;
    }
    </style>
    </head>
    <body>
    <h1>div Element for educba </h1>
    <div class="EduCBA">
    <h1>Data Science</h1>
    <p>Data analatics computer Science nachine learning </p>
    </div>
    </body>
    </html>
    登入後複製

    輸出:

    HTML5 語意

    範例 #6 –

    • 此元素用於定義使用者可以查看或隱藏的其他詳細資訊。
    • 此元素用於定義
      的可見標題。元素

    實施的計畫和

    代碼:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Details for the EduCBA Summery</title>
    <style>
    .GFG {
    Color:#red;
    font-size:60px;
    Text-align:left;
    margin-bottom:0px;
    }
    p {
    font-size:25px;
    text-align:left;
    margin-top:3px;
    }
    </style>
    </head>
    <body>
    <details>
    <summary class="EDUCBA">Make your Study easily with us</summary>
    <p>One of the best Data Science and web portal
    where you can learn good skills of programming.
    </p>
    </details>
    </body>
    </html>
    登入後複製

    輸出:

    HTML5 語意

    HTML5 語意

    1. 此元素用於指定頁面內容以外的內容。
    2. 此元素用於指定時間或日期。
    3. 此元素用於指定文件的主要內容。

    如何在一個範例中實作所有元素程式碼?

    這裡我們透過一個範例來了解如何實作元素程式碼。

    代碼:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Header Element for the page</title>
    <style>
    color:red;
    h1, h4 {
    Color:#red;
    Text-align:centre;
    margin-bottom:2px;
    }
    p {
    font-size:20px;
    text-align:centre;
    margin-top:2px;
    }
    </style>
    </head>
    <body style="background-color:LightCyan;">
    <article>
    <header>
    <h1>Educba learning bridge</h1>
    <nav>
    <a href="https://www.educba.com/">Home</a> |
    <a href="https://www.educba.com/data-science/">Data Science</a> |
    <a href="https://www.educba.com/software-development/">Software Development</a> |
    <a href="https://www.educba.com/design/">Design</a> |
    <a href="https://www.educba.com/finance/">Finance</a>
    </nav>
    <details>
    <h3>Become a technicall learner with EDUCBA</h3>
    <section>
    <h1><mark>AWS Tutorials for EduCBA</mark></h1>
    <p>Amazon Web Services (AWS) is one of the world's most popular and used cloud services. 175 supported services are available in AWS. </p>
    </section>
    <section>
    <h1><mark>Data Mining</mark></h1>
    <p>Through technological development such as big data and data science companies around the world have benefited from data mining by recognize opportunities and making their organizations efficient through waste reduction, to achieve their business goals.
    </p>
    </section>
    <p><em>EduCBA is the best online training institute in ASIA</em></p>
    </details></header>
    </article>
    </body>
    </html>
    登入後複製

    輸出:

    HTML5 語意

以上是HTML5 語意的詳細內容。更多資訊請關注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教學
1657
14
CakePHP 教程
1415
52
Laravel 教程
1309
25
PHP教程
1257
29
C# 教程
1230
24
HTML 中的表格邊框 HTML 中的表格邊框 Sep 04, 2024 pm 04:49 PM

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

See all articles