logo

HTMLに水平線を追加するにはどうすればよいですか?

視覚的に魅力的で適切に構成された Web ページを作成するには、多くの場合、水平線の使用が必要になります。これらの行は、コンテンツのさまざまなセクションを区切るのに役立ち、ユーザーが表示される情報を読んで理解しやすくなります。このガイドでは、HTML に水平線を追加する 2 つの効果的な方法を検討します。>

Javaのif else文

タグとCSSのプロパティ。

HTML に水平線を追加するさまざまなアプローチ

1. 使用方法
鬼ごっこ:

横罫 t で (




)HTML ドキュメントに水平線を挿入してドキュメントのセクションを区切るために使用されます。これは空のタグまたはペアになっていないタグであり、終了タグが必要ないことを意味します。

例: この例では、


タグを使用して水平線を追加します。

HTML
   横線タイトル>見出し> <body> <h2>さまざまな属性を使用した水平線sh2><hr width='100%' size='2'> <hr width='100%' size='2' color='blue' noshade> <hr width='100%;' color='red' size='5'>本文> html>>></pre> </code> <p dir='ltr'>  <b>  <strong>出力:</strong>  </b>  </p>  <img src='//techcodeview.com/img/html-questions/49/how-add-horizontal-line-html.webp' alt="hrタグを使用したHTMLの水平線"><p>出力</p><blockquote style="text-transform: capitalize;font-size: 20px; padding: 10px;"><a href="/register-transfer">レジスタ転送ロジック</a>
</blockquote> <h3>  <b>  <strong>2. CSS プロパティの使用:</strong>  </b>  </h3><p dir='ltr'><span>このアプローチでは、</span>   <i>  <em>ボーダースタイル</em>  </i>  <span>財産</span>  <i>  <em> </em>  </i>  <span>水平線を作成します。を使用することもできます。</span>   <i>  <em>ボーダートップ</em>  </i>   <span>上枠のスタイルを指定するプロパティ、または</span>   <i>  <em>ボーダーボトム</em>  </i>   <span>プロパティ。要素の下枠のスタイルを設定できます。どちらのプロパティも水平線を追加するために使用できます。</span></p> <p dir='ltr'>  <b>  <strong>例:</strong>  </b>  <span>この例では、</span>  <i>  <em>ボーダースタイル</em>  </i>  <span>財産。</span></p>HTML<code class='hljs'> <pre class='hljs'> <html> <head> <title>CSS プロパティを使用した水平線title><style>.horizo​​ntal_line {幅: 90%;  高さ: 5px;  border-top: 5 ピクセルの点線の黒。  行の高さ: 80%;  .line { border-bottom: 5 ピクセルの赤一色;  マージントップ: 5px;  幅: 90%;  スタイル>頭> <body> <h2>CSSプロパティを使用した水平線sh2><h3>水平点線h3><div>ディビジョン><h3>無地の水平線h3><div>div>本文>html>>></pre> </code> <p dir='ltr'>  <b>  <strong>出力:</strong>  </b>  </p>  <img src='//techcodeview.com/img/html-questions/49/how-add-horizontal-line-html-2.webp' alt="CSSを使用した横線の出力例"><p>出力</p>  <br>  <br></article><div class="rekl_placeholder"><script type="text/javascript">atOptions = {'key' : 'f2b09f3e7178b263531e10998e9a32fa','format' : 'iframe','height' : 250,'width' : 300,'params' : {}};</script><script type="text/javascript" src="//spiritscaution.com/f2b09f3e7178b263531e10998e9a32fa/invoke.js"></script></div> </article>
                         
                        </div><!--//content-->
                    </div><!--//section-inner-->                 
                </section><!--//section-->
    
            </div><!--//primary-->
            <div class="secondary col-md-4 col-sm-12 col-xs-12">
                  <aside class="info aside section">
                    <div class="section-inner">
                        <h2 class="">カテゴリ</h2>
                        <div class="content">
                            <ul class="list-unstyled">
                                <li> <a href="/acids-bases-salts/">酸、塩基、塩</a> </li><li> <a href="/chrome/">クロム</a> </li><li> <a href="/technical-scripter/">テクニカルスクリプター</a> </li><li> <a href="/geometry/">ジオメトリ</a> </li><li> <a href="/acceptable-use-policy/">利用規約</a> </li><li> <a href="/floyd-warshall/">フロイド・ウォーシャル</a> </li><li> <a href="/python-string-programs/">Python 文字列プログラム</a> </li><li> <a href="/typescript-tutorial/">Typescript チュートリアル</a> </li><li> <a href="/arithmetic-maq/">算術 - Maq</a> </li><li> <a href="/cucumber-testing/">キュウリの試験</a> </li>
                                
                            </ul>
                        </div><!--//content-->  
                    </div><!--//section-inner-->                 
                </aside><!--//aside-->
                
                 <aside class="testimonials aside section">
                	 <div class="section-inner">
                        <div class="content">
                            <div class="item">
  								<div class="rekl_placeholder" id="sidebar_placeholder_1"> <script type="text/javascript">atOptions = {'key' : 'f53f1abf3c3a788f849c12a956865db1','format' : 'iframe','height' : 300,'width' : 160,'params' : {}};</script><script type="text/javascript" src="//spiritscaution.com/f53f1abf3c3a788f849c12a956865db1/invoke.js"></script> <br></div>                                                   
                            </div>
                        </div>
                    </div>
                   <div class="section-inner">
                        <h2 class="heading">MySQL テーブルを CSV にエクスポート</h2>
                        <div class="content">
                            <div class="item">
                                 <blockquote class="quote">                                  
                                    <span> <i class="fa fa-quote-left"></i> MySQL を使用した CSV へのテーブルのエクスポート mysql チュートリアル、例、関数、プログラミング、mysql、リテラル、カーソル、プロシージャ、regexp_like()、regexp_replace 演算子、正規表現、crud など。</span>
                                </blockquote>                
                                                                                             
                            </div><!--//item-->
                            
                            <p> <a class="more-link" href="/mysql-export-table-csv"> <i class="fa fa-external-link"></i> 続きを読みます</a> </p> 
                            
                        </div><!--//content-->
                    </div><!--//section-inner-->
                </aside><!--//section-->
                
               
                            
                 <aside class="languages aside section">
                    <div class="section-inner">
                        <h2 class="heading">興味深い記事</h2>
                        <div class="content">
                            <ul class="list-unstyled">
                                <li class="item">
                                    <span class="title"> <strong> <a href="/black-water-benefits">黒水 : 利点と用途</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/postman-tutorial/">郵便配達員のチュートリアル</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/maths-formulas/">数学の公式</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/implementation-of-diffie-hellman-algorithm">Diffie-Hellman アルゴリズムの実装</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/java-inner-class/">Java 内部クラス</a> </strong> </span>
                                    
                                </li><!--//item-->
                               
                            </ul>
                        </div><!--//content-->
                    </div><!--//section-inner-->
                </aside><!--//section-->
                
              
                 <aside class="list music aside section">
                    <div class="section-inner">
                        <h2 class="heading">人気の投稿</h2>
                        <div class="content">
                            <ul class="list"> <li><a href="/difference-between-fox">オオカミ対キツネ</a>
</li><li><a href="/what-is-f5">キーボードのf5って何ですか?</a>
</li><li><a href="/java-scanner">スキャナJavaをインポートする</a>
</li><li><a href="/binary-search-algorithm">二分探索</a>
</li><li><a href="/java-convert-int-string">int を文字列 Java にキャストします</a>
</li> 
                                
                                
                            </ul>
                        </div><!--//content-->
                    </div><!--//section-inner-->
                </aside><!--//section-->
              
            </div><!--//secondary-->    
        </div><!--//row-->
    </div><!--//masonry-->
    
	    <footer class="footer">
        <div class="container text-center">
                <span>
Copyright ©2025 全著作権所有 |  <a href="//cs.techcodeview.com/">techcodeview.com</a> | <a href="/disclaimer" rel="nofollow noopener noreferrer" target="_blank">免責事項</a>  |  <a href="/about-us" rel="nofollow noopener noreferrer" target="_blank">私たちについて</a>  |  <a href="/privacy-policy" rel="nofollow noopener noreferrer" target="_blank">プライバシーポリシー</a>  </span>
        </div>
    </footer>
 
         
    <script type="text/javascript" src="https://techcodeview.com/template/assets/plugins/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="https://techcodeview.com/template/assets/plugins/bootstrap/js/bootstrap.min.js"></script>    
    

    <script type="text/javascript" src="https://techcodeview.com/template/assets/js/main.js"></script>     
	
	<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
	
</body>
</html>