検索

HTML5タグ

Sep 04, 2024 pm 04:36 PM
htmlhtml5HTML TutorialHTML PropertiesHTML tags

私たちは皆、HTML の標準的な略語である HyperText Markup Language を知っています。つまり、HTML5 は HTML の最新かつ新しいバージョンです。製品が開発されると、当然のことながら、HTML には多数のバージョンが存在し、その過程で多くの新しい開発が行われることになります。したがって、HTML5 には新しい属性と動作が追加されています。この HTML5 タグはもはやプログラミング言語ではありませんが、マークアップ言語です。さて、マークアップ言語とは何でしょうか?ドキュメント内でタグを使用して要素の属性を定義するのはマークアップ言語です。ここで、タグを定義して Web ページを作成する方法について詳しく説明します。

HTML5のタグ

タグはコンテンツを表示するための仕様です。通常、開始タグと終了タグがあります。また、 のような終了タグを必要としないタグもいくつかあります。これは改行を意味し、次の行からそのタグの隣にあるデータを表示します。ここでは、HTML5 の新しい要素をいくつか見てみましょう。

HTML5 では、一般にタグを 2 つのカテゴリに分類できます。

  • セマンティック要素: これらの要素の例はいくつかあります。 、、など
  • 非セマンティック要素: ここでの例は次のとおりです。
    など

    以下で説明するタグは、HTML5 バージョンのみで新たに導入されたタグです。これらはさまざまな種類のタグであり、すべて分類できます。

    1.構造タグ

    以下は構造タグの種類と例です:

    a.記事: headタグと同様に主に使われるタグです。主にフォーム、ブログ、ニュース記事などで例として使用されます。

    コード:

    <article> <h3 id="The-first-one">The first one </h3></article>
    
    <h2>Welcome Back
    
    </h2>

    出力:

    HTML5タグ

    b.余談: 通常のタグに似たもので、記事のサイドバーなど、コンテンツを周囲のコンテンツに関連付けます。また、このタグは、IE バージョン 8 以降を使用する場合にのみ意味を持ちます。

    c.詳細: このタグは、ユーザーに追加データを提供するために使用されます。これは、詳細を非表示または表示できる対話型プラットフォームにすることができます。このタブの使用状況は、概要タグの下で確認できます。

    d.ヘッダー: このタグはヘッダー部分に関連しており、タイトル情報が含まれます。開始タグと終了タグの両方が必要です。

    コード:

    <header>
    <h1 id="Happy-Hours">Happy Hours</h1>
    <nav>
    <p><a href="#">Morning</a> | <a href="#">Afternoon</a> | <a href="#">Evening</a></p>
    </nav>
    </header>
    

    出力:

    HTML5タグ

    e。 hgroup: このタグは、ヘッダーのグループを記述するために使用されます。例を見てみましょう。

    コード:

    
    <hgroup>
    <h1 id="Let-s-check-size-of-this-h">Let’s check size of this h1 </h1>
    <h2 id="Let-s-check-size-of-this-h"> Let’s check size of this h2 </h2>
    <h3 id="Let-s-check-size-of-this-h"> Let’s check size of this h3</h3>
    <h4 id="Let-s-check-size-of-this-h"> Let’s check size of this h4</h4>
    <h5 id="Let-s-check-size-of-this-h"> Let’s check size of this h5</h5>
    </hgroup>
    
    

    出力:

    HTML5タグ

    f. Footer: このタグは、ページの最後に配置されるタグです。著作権、歴史関連の情報、データなどを扱います。以下に小さな例を見てみましょう。

    コード:

    
    <footer>
    <nav>
    <p><a href="#">Copy Rights</a> | <a href="#">Come back soon</a></p>
    </nav>
    <p>Please subsribe for more learning content</p>
    </footer>
    
    

    出力:

    HTML5タグ

    g。 nav: このタグは、ナビゲーション用のすべてのリンクのセクションを提供するためのものです。

    コード:

    
    <nav>
    <ul>
    <li><a href="https://www.educba.com/">EDUCBA Home</a></li>
    <li><a href="https://www.educba.com/about-us/">About EDUCBA</a></li>
    <li><a href="https://www.educba.com/courses/">Courses in EDUCBA</a></li>
    </ul>
    </nav>
    
    

    出力:

    HTML5タグ

    練習中にコードを書いたら、リンクをクリックして確認してください。

    ふ。セクション: 名前がすでに示しているように、このタグは本文、ヘッダー、フッターなどのコードの部分を定義します。ここでは、開始タグと終了タグの両方が必要です。以下に小さな例を見てみましょう:

    コード:

    <section>
    <h1 id="Welcome"> Welcome </h1>
    <h4 id="See-you-soon"> See you soon </h4>
    <p>Thank You.</p>
    </section>
    

    出力:

    HTML5タグ

    私。概要: このタグは、詳細タブと並行して使用されます。詳細タグの下には、概念を要約するための概要タグがあります。以下の例:

    コード:

    
    <details>
    <summary>How is this Summary tag defined?</summary>
    <p>By clicking the arrow beside the Summary question I got displayed</p>
    </details>
    <p> The data after the display tag is displayed like this.</p>
    
    

    出力:

    HTML5タグ

    概要タグ データを展開すると、以下が得られます。

    HTML5タグ

    2.フォームタグ

    ここでは、さまざまなタイプのフォームタグを例とともに説明します。

    a. Datalist: このタグは、ユーザーが選択できる事前定義された値を含むドロップダウンのように使用されます。以下の小さな例を見てみましょう:

    コード:

    
    <p>Enter your favorite browser name:</p>
    <input type="text" list="browsers">
    <datalist id="browsers">
    <option value="Firefox">
    </option>
    <option value="Chrome">
    </option>
    <option value="Internet Explorer">
    </option>
    <option value="Opera">
    </option>
    <option value="Safari">
    </option></datalist>
    
    

    出力:

    HTML5タグ

    マウスをホバーすると、ドロップダウンが表示されます。

    HTML5タグ

    b. Keygen: This is for the encryption. It is for generating an encrypted key for passing the data in an encrypted format. Only the start tag is enough/required for this element, and the end tag is not mandatory.

    c. Meter: This tag would give us the measurement of the data which is present in a given range.

    Code:

    
    <meter value="25" min="0" max="100">25 out of 100</meter><p> This is 25 out of 100 </p><br>
    <meter value="0.7">70%</meter><p> This is the range for 70%</p>
    
    

    Output:

    HTML5タグ

    3. Formatting Tags

    Below are the types of formatting tag with examples:

    a. BDI: This is Bi-directional isolation. As the name already suggests, this tag can be used to isolate a part of the text and give it different styles from that of other text.

    b. Mark: This tag can help us highlight a specific text.

    Code:

    
    <p>This is how you can <mark>mark or highlight</mark> a text.</p>
    
    

    Output:

    HTML5タグ

    c. Output: As the name already shows us, it gives the result of any calculation.

    Code:

    
    
    =

    Output:

    HTML5タグ

    Make sure that you notice the form attribute of oninput. Once you input the attribute ‘x’ value, then the output gets displayed.

    d. Progress: This tag gives us the progress of a particular task.

    Code:

    
    <progress value="80" max="100"></progress><p> This progress bar is 80% completed</p>
    
    

    Output:

    HTML5タグ

    e. Rp: This is used when the ruby tags are not supported.

    f. Rt: It is used with the tag ruby. Mostly this is used in pronunciation in both Japanese and Chinese languages.

    g. Ruby: This tag is used with the rt and rp tags where the annotations with respect to the two languages, Chinese and Japanese, are pronounced.

    h. Wbr: This tag is for the word break. It is mainly used to check how a word breaks when the window size is resized.

    4. Embedded Content Tags

    Here are the types of embedded content tag explained below with examples:

    a. Audio: As the name already suggests, this tag would help us to incorporate audio files in the HTML document.

    b. Canvas: Defines a place on the web page where graphics or shapes, or graphs are present or can be defined. Here is an example.

    Code:

    
    <canvas id="run"></canvas>
    <script type="text/javascript">
    window.onload = function(){
    var can = document.getElementById("run");
    var context = can.getContext("2d");
    context.moveTo(30, 60);
    context.lineTo(150, 30);
    context.stroke();
    };
    </script>
    
    

    Output:

    HTML5タグ

    c. Dialog: This tag gives us a default box, especially if we wanted to have data in a box.

    Code:

    
    <p> Trying dialog here <dialog open>How does dialog box come up?</dialog> </p>
    
    

    Output:

    HTML5タグ

    d. Embed: This tag can be used for getting in any external file to the HTML file. We can have only the start tag, and the end tag is not mandatory here. There are different attributes that can be used with this tag, namely, width, height, src, and type.

    e. Figure and Figcaption: This, as already in its name, can incorporate the images and can give a caption to that image.

    f. Source: This tag can implement multiple audio and video files by providing the location of the files using this source tag.

    g. Time: This tag, as the name already notifies, is a tag for displaying the time. And note that this tag is not functional in the cases of internet explorer version 8 and below.

    h. Video: With the name of the tag, we can obviously get to know where this tag is used. For specifying the video files, we have this tag. Inside this Audio/Video tags, we define the source tags in specifying the files and their locations.

    Input Elements of HTML5 Tags

    Here are some input elements which we are using in HTML5 tags:

    1. Email: This is one of the input elements in HTML5. This element takes in only email addresses as the input.

    2. Number: This input element only accepts the number.

    3. Range: As the name already explains, this tag contains a range of numbers.

    4. URL: This input tag accepts the input field for the URL address. In this input type, we can only enter the URL.

    5. Placeholder: This is one of the attributes for the input type as text or text area or any number. This place holder value shows the value to be given as the input.

    Code:

    
    Enter Date of birth : <input type="text" name="dob" placeholder="dd/mm/yyyy">
    
    

    Output:

    HTML5タグ

    6. Autofocus: This attribute automatically focuses on a particular field where this element has been declared inside the input tag. This attribute is supported only by the latest versions of Chrome, Safari, and Mozilla only. The syntax is like this:

    <input type="“textarea”" name="”focus”" autofocus>
    Tag 
    : This tag represents a description of a definition. Tag : This tag deletes a specified text. Tag : This tag helps to display data in a scrolling manner. This texxt is in a scrolling manner

    Output:

    HTML5タグ

    7. : This is one of the basic tags that would help the browser understand the HTML version in which the program is being written. The declaration of this tag is to be written before the HTML tag.

    8. : This Meta tag describes the description of the HTML document. It contains the author’s name, date, and modifications, etc.

    In this HTML5, we even have an opportunity to get the GeoLocation of a device. There are different methods that can be helpful in making this location tagging easy. There are also different fonts and colors available in HTML5. Below are the few tags that are removed from the HTML usage from this HTML5 version.

    Acronym, Applet, big, dir, font, frameset, center, tt (TeleType text), basefont, center, strike, frame, u (underlined text), isindex, noframes, etc. Few attributes that are removed are below:

    Align, bgcolor, cellpadding, cellspacing, border, link, shape, charset, archive, codebase, scope, alink, vlink, link, background, border, clear, scrolling, size, width, etc.

    9. This tag is used to display the content where the use of JavaScript is disabled. Any content written inside this tag can be used in place of the content wherever javascript is used. As an exercise, can you try executing the different tags for which examples are not provided?

    Conclusion

    So, yes, there are the basic tags and references for HTML5. The initial version of HTML5 was released on 28th October 2014. We have seen different new tags that were introduced and had gone through a few attributes in HTML5. In the end, we had even covered that not only the introduction of new elements was done, but some elements and attributes that were present were restricted from use through this new release of HTML5.

    There were many attributes that were given with examples and some with only the data and the purpose of the attribute or elements. Try practicing all those different elements and attributes and keep learning.

以上がHTML5タグの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
HTMLコードをどのように検証できますか?HTMLコードをどのように検証できますか?Apr 24, 2025 am 12:04 AM

HTMLコードは、オンラインバリデーター、統合ツール、自動化されたプロセスを使用するとクリーンになります。 1)w3cmarkupvalidationserviceを使用して、HTMLコードをオンラインで確認します。 2)リアルタイム検証のためにVisualStudiocodeにhtmlhint拡張機能をインストールして構成します。 3)HTMLTIDYを使用して、建設プロセスでHTMLファイルを自動的に検証およびクリーニングします。

HTML対CSSおよびJavaScript:Webテクノロジーの比較HTML対CSSおよびJavaScript:Webテクノロジーの比較Apr 23, 2025 am 12:05 AM

HTML、CSS、およびJavaScriptは、最新のWebページを構築するためのコアテクノロジーです。1。HTMLはWebページ構造を定義します。2。CSSはWebページの外観に責任があります。

マークアップ言語としてのHTML:その機能と目的マークアップ言語としてのHTML:その機能と目的Apr 22, 2025 am 12:02 AM

HTMLの機能は、Webページの構造とコンテンツを定義することであり、その目的は、情報を表示するための標準化された方法を提供することです。 1)HTMLは、タイトルやパラグラフなどのタグや属性を使用して、Webページのさまざまな部分を整理しています。 2)コンテンツとパフォーマンスの分離をサポートし、メンテナンス効率を向上させます。 3)HTMLは拡張可能であり、カスタムタグがSEOを強化できるようにします。

HTML、CSS、およびJavaScriptの未来:Web開発動向HTML、CSS、およびJavaScriptの未来:Web開発動向Apr 19, 2025 am 12:02 AM

HTMLの将来の傾向はセマンティクスとWebコンポーネントであり、CSSの将来の傾向はCSS-in-JSとCSShoudiniであり、JavaScriptの将来の傾向はWebAssemblyとServerLessです。 1。HTMLセマンティクスはアクセシビリティとSEO効果を改善し、Webコンポーネントは開発効率を向上させますが、ブラウザの互換性に注意を払う必要があります。 2。CSS-in-JSは、スタイル管理の柔軟性を高めますが、ファイルサイズを増やす可能性があります。 CSShoudiniは、CSSレンダリングの直接操作を可能にします。 3. Webassemblyブラウザーアプリケーションのパフォーマンスを最適化しますが、急な学習曲線があり、サーバーレスは開発を簡素化しますが、コールドスタートの問題の最適化が必要です。

HTML:構造、CSS:スタイル、JavaScript:動作HTML:構造、CSS:スタイル、JavaScript:動作Apr 18, 2025 am 12:09 AM

Web開発におけるHTML、CSS、およびJavaScriptの役割は次のとおりです。1。HTMLは、Webページ構造を定義し、2。CSSはWebページスタイルを制御し、3。JavaScriptは動的な動作を追加します。一緒に、彼らは最新のウェブサイトのフレームワーク、美学、および相互作用を構築します。

HTMLの未来:ウェブデザインの進化とトレンドHTMLの未来:ウェブデザインの進化とトレンドApr 17, 2025 am 12:12 AM

HTMLの将来は、無限の可能性に満ちています。 1)新機能と標準には、より多くのセマンティックタグとWebComponentsの人気が含まれます。 2)Webデザインのトレンドは、レスポンシブでアクセス可能なデザインに向けて発展し続けます。 3)パフォーマンスの最適化により、応答性の高い画像読み込みと怠zyなロードテクノロジーを通じてユーザーエクスペリエンスが向上します。

HTML対CSS対JavaScript:比較概要HTML対CSS対JavaScript:比較概要Apr 16, 2025 am 12:04 AM

Web開発におけるHTML、CSS、およびJavaScriptの役割は次のとおりです。HTMLはコンテンツ構造を担当し、CSSはスタイルを担当し、JavaScriptは動的な動作を担当します。 1。HTMLは、セマンティクスを確保するためにタグを使用してWebページの構造とコンテンツを定義します。 2。CSSは、セレクターと属性を介してWebページスタイルを制御して、美しく読みやすくします。 3。JavaScriptは、動的でインタラクティブな関数を実現するために、スクリプトを通じてWebページの動作を制御します。

HTML:それはプログラミング言語か何か他のものですか?HTML:それはプログラミング言語か何か他のものですか?Apr 15, 2025 am 12:13 AM

htmlisnotaprogramminglanguage; itisamarkuplanguage.1)htmlStructuresandformatswebcontentusingtags.2)ItworkswithcsssssssssdjavascriptforInteractivity、強化を促進します。

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

mPDF

mPDF

mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

VSCode Windows 64 ビットのダウンロード

VSCode Windows 64 ビットのダウンロード

Microsoft によって発売された無料で強力な IDE エディター

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

PhpStorm Mac バージョン

PhpStorm Mac バージョン

最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強力な PHP 統合開発環境