ホームページ  >  記事  >  ウェブフロントエンド  >  HTML5 セマンティクス

HTML5 セマンティクス

PHPz
PHPzオリジナル
2024-09-04 16:37:031139ブラウズ

HTML5 セマンティクス要素には、コンポーネントのタイプを反映する重要な名前があります。テーブル、ヘッダー、フッターなどの例を見てみましょう

  • <マーク>
  • <ナビゲーション>
  • <セクション>
  • <時間>

HTML4 の場合、開発者は独自の ID/クラス名を使用して、トップ、ヘッダー、ボトムス、メニュー、フッター、プライマリ、ナビゲーション、マテリアル、オブジェクト、トップナビゲーション、サイドバーなどの要素をデザインします。ただし、このため、検索エンジンは Web ページの正しいコンテンツを識別できませんでした。

HTML5 セマンティクスの例

次に、HTML5 セマンティクス要素の例をいくつか見てみましょう:

例 #1 –

名前が示すように、ページの導入セグメントのヘッダーを指します。 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. : この要素は、ドキュメントのメインコンテンツを指定するために使用されます。

すべての要素のコードを 1 つの例で実装するにはどうすればよいですか?

ここでは、一例として要素コードを実装する方法を示します。

コード:

<!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 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
前の記事:HTML5タグ次の記事:HTML5タグ