ホームページ  >  記事  >  ウェブフロントエンド  >  HTMLコマンド

HTMLコマンド

王林
王林オリジナル
2024-09-04 16:13:50740ブラウズ

HTML は、Web ページの標準マークアップ言語であるハイパー テキスト マークアップ言語を意味します。 HTML には要素、属性、その他のタグが含まれます。インターネット上に存在する Web サイトのほとんどは HTML を使用しています。 HTML は習得が簡単で強力です。ハイパー テキストは、ハイパーリンクをクリックして別のページにリダイレクトすることで、Web 上を移動する主な方法です。マークアップでは、テストを特定のタイプとしてマークすることで、HTML タグを使用してテスト内のテキストを表示します。 HTML コマンド要素は HTML ページの構成要素であり、要素に関する追加情報を提供する属性を持つことができ、属性はペアで存在します。

基本的な HTML コマンド

基本的なコマンドは次のとおりです:

1.サンプル HTML ドキュメント構文

サンプル HTML ドキュメントには、Web ページの構成要素である HTML 要素が含まれます。HTML 要素の一部は、ルート要素である 、 です。これにはメタ情報が含まれます。

これにはドキュメントのタイトルと が含まれます。これにはドキュメントのデータが含まれます。

コード:

html>

<meta>
<title>Page Title</title>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

出力:

HTMLコマンド

2. HTML 見出し

HTML 見出しは、タグ

で定義される HTML 要素です。

へここで、

最も重要なタグと

を定義します。重要度の低いタグを定義します。

以下のような見出しを持つサンプル HTML コード:

<h1> This is heading 1 </h1>
<h2> This is heading 2 </h2>
<h3> This is heading 3 </h3>
<h4> This is heading 4 </h4>

出力:

HTMLコマンド

3. HTML 要素の段落

HTML 段落は、

を使用して定義する HTML 要素です。タグ、サンプルコードは次のとおりです:

<p> This is a paragraph </p>
<p> This is another paragraph </p>

出力:

HTMLコマンド

4. HTML 画像

HTML 画像は HTMLコマンド タグで定義された HTML 要素であり、画像の src 、alt は代替テキスト、表示する画像の幅、高さを意味するなどの属性を記述する必要があります。サンプルコードは次のとおりです。

コード:

<img src="HTML%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89.jpg" alt="HTMLコマンド"   style="max-width:90%">

出力:

HTMLコマンド

5. HTML リスト

HTML リストは HTML 要素であり、タグ

    を使用して定義されます。または
    ;ここで
    は順序なしリストであり、
    順序付きリスト

    コード:

    
    
  • Coffee
  • Tea
  • Milk

出力:

HTMLコマンド

6.テーブルの作成

HTML テーブルは HTML 要素であり、タグ

を使用して定義できます。およびタグ を持つ行タグ
が付いたセル以下のようにコードを記述します:

コード:


Firstname Lastname Age
Jill Smith 50

出力:

HTMLコマンド

7.リンクに言及

HTML リンクは HTML 要素であり、タグ を使用して定義できます。サンプルコードは以下のとおりです:

コード:

<a href="https://www.HTML%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89.com">This is a link </a>

出力:

HTMLコマンド

8.スタイル属性

HTML 属性スタイルは、

などの任意の HTML 要素の組み合わせで使用できます。サンプル コードは次のとおりです。

コード:

<p style="color:red"> I am a paragraph </p>

出力:

HTMLコマンド

9. lang 属性

HTML では、lang 属性を使用して、 を使用してドキュメントの言語を宣言できます。タグ、言語は lang 属性を使用して定義されており、サンプルコードは次のとおりです:

コード:



...
...

出力:

HTMLコマンド

10. HTML 要素の書式設定

HTML では、書式設定要素を使用して HTML ドキュメントを書式設定したり、特別な意味を持つテキストの特別な要素を定義したりできます。 のような HTML 要素太字の場合は 斜体

コード:

<b> This text is bold. </b>

出力:

HTMLコマンド

中間 HTML コマンド

中間コマンドは次のとおりです:

1.テキストを強調表示

HTML では、要素 を使用して HTML ドキュメント内のテキストを強調表示できます。 で囲まれたテキストが強調表示されるようにします。要素、サンプルコードは以下のとおりです:


<h2> html <mark> Marked </mark> formtting </h2>

出力:

HTMLコマンド

2. Delete text

In HTML, we can delete some text using element so that the text which is enclosed between this element is deleted, and the sample code is as below:


<p> My favorite color is <del> Navy blue </del> Red </p>

Output:

HTMLコマンド

3. Define superscripted text

In HTML, we can define the text as superscripted using element in the HTML document so that text enclosed in element will be superscripted, and the sample code is as below:


<p> This is <sup> superscripted </sup> text </p>

Output:

HTMLコマンド

4. Define abbreviation

In HTML, we can define abbreviations by using the HTML element in the HTML document, which will give useful information to browsers, and the sample code is as below:


<p> The <abbr title="World Health Organization">WHO </abbr> was founded in 1948 </p>

Output:

HTMLコマンド

5. Mention Address

In HTML, we can mention the address in an HTML document using HTML element

, which defines contact information or address related to the article or document and displays in italics and the sample code as below:

<address>
Written by Srinivas <br>
dasu.com <br>
Pincode : 500084, Hyderabad <br>
India
</address>

Output:

HTMLコマンド

Advanced HTML Commands

The advanced commands are as follows:

1. Display a webpage inside a webpage

In HTML, we can display a webpage inside a webpage using HTML iframe, which is defined using the tag


<iframe src="demo.html" height="300" width="300"> </iframe>

2. Target different targets using iframe

In HTML, we can use the target frame as a link using the iframe tag in the HTML document, and the target attribute to the link must refer to the name attribute of the iframe and sample code is as below:


<iframe src="demo.html" name="iframe1"> </iframe>
<p> <a href="www.google.com" target="iframe1"> Google.co.in </a> </p>

Tips and Tricks to Use HTML Commands

  • Make your visitors change the text color or background by adding extra code.
  • Add metadata while writing an HTML document.
  • It’s good to hide some fields where we don’t want a user to edit them.
  • Always add a horizontal line to break long sections so the website will look good.

Conclusion

Finally, it’s all about different types of HTML commands of various levels are briefly discussed with examples. After reading this article, I hope you will have a good idea of how to use HTML commands.

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

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