logo

HTMLに行を追加する方法

HTML では、次のさまざまな方法を使用して、ドキュメントに水平線を簡単に追加できます。

  1. HTMLタグの使用
  2. 内部 CSS の使用

HTMLの使用

HTMLドキュメントに水平線を追加したい場合は、次のようにします。 HTMLタグ , 次に、以下に示す手順に従う必要があります。これらの手順を使用すると、次の行を簡単に追加できます。

ステップ1: まず、テキスト エディターに HTML コードを入力するか、水平線を追加する既存の HTML ファイルをテキスト エディターで開く必要があります。

 Add the Line using Html tags This page helps you to understand how to add the line in Html document. And, this section helps you to understand how to add the line using the Html tags. 

ステップ2: 次に、HTML ドキュメント内の行を追加する位置にカーソルを置きます。そして、それを使用する必要があります。


その時点のHTMLのタグ。

 <hr> 

ステップ 3: ここで、次の属性を追加する必要があります。


タグは、線のサイズ、色、幅を定義します。したがって、サイズ、幅、色の属性を
鬼ごっこ。

 <hr> 

ステップ 4: そして、これらの属性の値を指定する必要があります。

 <hr> 

ステップ5: そして最後に、HTML コードを保存し、ブラウザでファイルを実行する必要があります。

 Add the Line using Html tags This page helps you to understand how to add the line in Html document. <hr> And, this section helps you to understand how to add the line using the Html tag. 
今すぐテストしてください

上記の HTML コードの出力を次のスクリーンショットに示します。

HTMLに行を追加する方法

内部 CSS の使用

内部スタイルシートを使用して HTML ドキュメントに水平線を追加する場合は、以下の手順に従う必要があります。これらの手順を使用すると、次の行を簡単に追加できます。

ステップ1: まず、テキスト エディターに HTML コードを入力するか、水平線を追加する既存の HTML ファイルをテキスト エディターで開く必要があります。

 Add the Line using Internal CSS. This page helps you to understand how to add the line in Html document. And, this section helps you to understand how to add the line using the Internal Cascading Style Sheet. 

ステップ2: ここで、タイトルタグの終了直後にカーソルを置く必要があります。 ヘッドタグ HTML ドキュメントの内部のスタイルを定義します。 次のブロックに示すようにタグを追加します。次に、水平線のスタイルを設定するために hr CSS タグを入力する必要があります。

 Add the Line using Internal CSS. hr { } 

ステップ 3: 次に、hr CSS タグの属性を定義する必要があります。したがって、次のブロックでさまざまな属性を定義します。

 Add the Line using Internal CSS. hr { width: 80%; height: 2px; background-color: pink; margin-bottom: 7px; margin-right: auto; margin-left: auto; margin-top: 9px; border-width: 4px; border-color: blue; } 

ステップ 4: ここで、次のように入力する必要があります。


HTML ドキュメントの本文に タグを追加して、Web ページに水平線を表示します。最後に、HTML ファイルを保存し、インターネット ブラウザでそのファイルを実行する必要があります。

 Add the Line using Internal CSS. hr { width: 80%; height: 2px; background-color: pink; margin-bottom: 7px; margin-right: auto; margin-left: auto; margin-top: 9px; border-width: 4px; border-color: blue; } This page helps you to understand how to add the line in Html document. <hr> And, this section helps you to understand how to add the line using the Internal Cascading Style Sheet. 
今すぐテストしてください

上記の HTML コードの出力を次のスクリーンショットに示します。

HTMLに行を追加する方法