CSSのdivブロック内のテキストを(水平方向と垂直方向)中央揃えにするにはどうすればよいですか?

CSSのdivブロック内のテキストを(水平方向と垂直方向)中央揃えにするにはどうすればよいですか?

div ブロック内のテキストを水平方向と垂直方向の両方で中央揃えにする 視覚的に魅力的なレイアウトを作成するために重要です。フレックスボックス、グリッド、CSS 変換などのさまざまな方法は、明確な利点と欠点を備えたソリューションを提供します。この記事では、div ブロック内でテキストを中央揃えにするための一般的なアプローチを検討します。

目次

フレックスボックスの使用:

  • 親コンテナを次のように設定します。 ディスプレイ: フレックス; これにより、 フレックスボックス そして親コンテナをフレックスコンテナに変えます。
  • 使用 コンテンツの位置揃え: 中央 子要素を親コンテナ内で水平方向の中央に配置します。
  • 使用 項目の配置: 中央 子要素を親コンテナ内で垂直方向の中央に配置します。

例: この例では、 の flexbox プロパティを使用して div 内のテキストを中央揃えにする方法を示します。 CSS

HTML
      div ブロック タイトル内のテキストを水平方向と垂直方向に中央揃えにします> <style>body { テキスト整列: 中央;  .container { 高さ: 300px;  幅: 645ピクセル;  ディスプレイ: フレックス;  コンテンツの位置揃え: 中央;  整列項目: 中央;  境界線: 2 ピクセルの黒一色。  } h1 { 色: 緑;  スタイル>頭> <body>  <div>  <h1>GeekforGeeksh1> div> body> html>> </pre>  </code>  <p dir='ltr'>  <b>  <strong>出力: </strong>  </b>  </p>  <img src='//techcodeview.com/img/css-questions/74/how-center-text-horizontally.webp' alt=''> <h2 id='using-grid'> <span>グリッドの使用 </span> </h2> <ul> <li value='1'>  <span>CSSグリッド </span>  <span>は、複雑で柔軟なグリッドベースのレイアウトを作成できる、もう 1 つの人気のあるレイアウト ツールです。 </span> </li> <li value='2'> <span>親コンテナを次のように設定します。 </span>   <b>  <strong>表示: グリッド </strong>  </b>   <span>。これにより、CSS グリッドの使用が有効になり、親コンテナがグリッド コンテナに変わります。 </span> </li> <li value='3'> <span>使用 </span>  <b>  <strong>  </strong>  </b>   <b>  <strong>アイテムを配置: 中央 </strong>  </b>   <span>プロパティを使用して、子要素をグリッド セル内で水平方向と垂直方向の両方の中央に配置します。このプロパティは両方の短縮形です。 </span>  <b>  <strong>項目の位置揃え </strong>  </b>  <span>そして </span>  <b>  <strong>アイテムの整列 </strong>  </b>  <span>。 </span> </li> </ul> <p dir='ltr'>  <b>  <strong>例: </strong>  </b>  <span>この例では、CSS の Grid プロパティを使用して div 内のテキストを中央揃えにする方法を示します。 </span> </p>HTML <code>  <pre>  <html lang='en'>  <head>  <title>div ブロック タイトル内のテキストを水平方向と垂直方向に中央揃えにします> <style>.container { 高さ: 300px;  幅: 645ピクセル;  表示: グリッド;  アイテムを配置: 中央;  境界線: 2 ピクセルの黒一色。  } h1 { 色: 緑;  スタイル>頭> <body>  <div>  <h1>GeekforGeeksh1> div> body> html>> </pre>  </code>  <p dir='ltr'>  <b>  <strong>出力: </strong>  </b>  </p>  <img src='//techcodeview.com/img/css-questions/74/how-center-text-horizontally.webp' alt=''> <h2 id='using-text-align'>  <b>  <strong>テキスト整列の使用: </strong>  </b>  </h2> <ul> <li value='1'> <span>の </span>  <span>テキスト整列 </span>  <span>プロパティは、div ブロック内でテキストを水平方向に中央揃えにするシンプルで簡単な方法です。 </span> </li> <li value='2'> <span>親コンテナを次のように設定します。 </span>  <b>  <strong>テキスト配置: 中央。 </strong>  </b>  <span>これにより、子要素が親コンテナ内で水平方向の中央に配置されます。 </span> </li> <li value='3'> <span>使用 </span>  <b>  <strong>行の高さ: </strong>  </b>  <span>子要素を親コンテナ内で垂直方向の中央に配置します。の値は親コンテナの高さと同じである必要があります。 </span> </li> </ul> <p dir='ltr'>  <b>  <strong>例: </strong>  </b>  <span>この例では、CSS のテキスト配置を使用して div 内のテキストを中央揃えにする方法を示します。 </span> </p>HTML <code>  <pre>  <html lang='en'>  <head>  <title>div ブロック タイトル内のテキストを水平方向と垂直方向に中央揃えにします> <style>.container { 高さ: 300px;  幅: 645ピクセル;  テキスト整列: 中央;  行の高さ: 400px;  境界線: 2 ピクセルの黒一色。  } h1 { 色: 緑;  スタイル>頭> <body>  <div>  <h1>GeekforGeeksh1> div> body> html>> </pre>  </code>  <p dir='ltr'>  <b>  <strong>出力: </strong>  </b>  </p>  <img src='//techcodeview.com/img/css-questions/74/how-center-text-horizontally.webp' alt=''> <h2 id='using-table-cell'> <span>表のセルの使用 </span> </h2> <ul> <li value='1'> <span>親コンテナを次のように設定します。 </span>  <b>  <strong>ディスプレイ: テーブル。 </strong>  </b>  <span>これはテーブルの動作をエミュレートします。 </span> </li> <li value='2'> <span>子要素を次のように設定します </span>  <b>  <strong>表示: テーブルセル </strong>  </b>  <span>。これは表のセルの動作をエミュレートします。 </span> </li> <li value='3'> <span>使用 </span>  <b>  <strong>垂直配置: 中央 </strong>  </b>  <span>子要素を親コンテナ内で垂直方向の中央に配置します。 </span> </li> <li value='4'> <span>使用 </span>  <b>  <strong>テキスト配置: 中央 </strong>  </b>  <span>子要素を親コンテナ内で水平方向の中央に配置します。 </span> </li> </ul> <p dir='ltr'>  <b>  <strong>例: </strong>  </b>  <span>この例では、CSS のテキスト テーブル セルを使用して、div 内のテキストを中央揃えにする方法を示します。 </span> </p>HTML <code>  <pre>  <html lang='en'>  <head>  <title>div ブロック タイトル内のテキストを水平方向と垂直方向に中央揃えにします> <style>.container { 高さ: 300px;  幅: 645ピクセル;  表示: テーブルセル;  テキスト整列: 中央;  垂直配置: 中央;  境界線: 2 ピクセルの黒一色。  } h1 { 色: 緑;  スタイル>頭> <body>  <div>  <h1>GeekforGeeksh1> div> body> html>> </pre>  </code>  <p dir='ltr'>  <b>  <strong>出力: </strong>  </b>  </p>  <img src='//techcodeview.com/img/css-questions/74/how-center-text-horizontally.webp' alt=''> <h2 id='using-transform-property'> <span>Transform プロパティの使用: </span> </h2> <ul> <li value='1'> <span>親コンテナを次のように設定します。 </span>  <b>  <strong>位置: 相対的。 </strong>  </b>  <span>これにより、子要素に絶対配置を使用できるようになります。 </span> </li> <li value='2'> <span>子要素を次のように設定します </span>  <b>  <strong>位置: 絶対。 </strong>  </b>  <span>これにより、子要素に絶対配置を使用できるようになります。 </span> </li> <li value='3'> <span>子要素の設定 </span>  <b>  <strong>上 </strong>  </b>  <span>そして </span>  <b>  <strong>左 </strong>  </b>  <span>プロパティを </span>  <b>  <strong>50% </strong>  </b>  <span>。これにより、子要素が親コンテナの中央に配置されます。 </span> </li> <li value='4'> <span>使用 </span>  <b>  <strong>変換: 変換(-50%、-50%) </strong>  </b>  <span>子要素を水平方向と垂直方向の両方で中央揃えにします。 </span> </li> </ul> <p dir='ltr'>  <b>  <strong>例: </strong>  </b>  <span>この例では、CSS の transform プロパティを使用して div 内のテキストを中央揃えにする方法を示します。 </span> </p>HTML <code>  <pre>  <html lang='en'>  <head>  <title>div ブロック タイトル内のテキストを水平方向と垂直方向に中央揃えにします> <style>.container { 高さ: 300px;  幅: 645ピクセル;  位置: 相対的;  境界線: 2 ピクセルの黒一色。  } h1 { 位置: 絶対;  トップ: 50%;  色: 緑;  左: 50%。  変換: 変換(-50%, -50%);  スタイル>頭> <body>  <div>  <h1>GeekforGeeksh1> div> body> html>> </pre>  </code>  <p dir='ltr'>  <b>  <strong>出力: </strong>  </b>  </p>  <img src='//techcodeview.com/img/css-questions/74/how-center-text-horizontally.webp' alt=''> <p dir='ltr'> <span>要約すると、選択するアプローチは、特定の使用例、他の要素との互換性、および望ましいデザインの美学によって異なります。これらの方法を使用すると、さまざまなレイアウトやデザインでテキスト ブロックを中央揃えにすることができます。 </span> </p>  <br>  <br>
                     </div>

                     <!-- Article Footer with Prominent Share Buttons -->
                     <div class="px-6 md:px-8 py-8 bg-slate-50 dark:bg-slate-900/50 border-t border-slate-200 dark:border-slate-700/50">
                          <div class="flex flex-col sm:flex-row items-center justify-between gap-6">
                              <h4 class="text-base font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wide flex items-center gap-2">
                                 <i class="fa fa-share-alt text-tech-500"> </i>
                                共有                              </h4>
                             
                              <div class="flex flex-wrap justify-center gap-3">
                                 <!-- Twitter -->
                                 <a href="https://twitter.com/intent/tweet?text=CSSのdivブロック内のテキストを(水平方向と垂直方向)中央揃えにするにはどうすればよいですか?&url=https://www.techcodeview.com/ja/how-center-text-horizontally" 
                                   target="_blank" rel="noopener noreferrer" 
                                   class="flex items-center gap-2 px-6 py-3 rounded-xl bg-[#1DA1F2]/10 text-[#1DA1F2] hover:bg-[#1DA1F2] hover:text-white transition-all duration-300 font-bold text-sm">
                                     <i class="fa fa-twitter text-lg"> </i>
                                     <span class="hidden sm:inline">Twitter </span>
                                 </a>

                                 <!-- Facebook -->
                                 <a href="https://www.facebook.com/sharer/sharer.php?u=https://www.techcodeview.com/ja/how-center-text-horizontally" 
                                   target="_blank" rel="noopener noreferrer"
                                   class="flex items-center gap-2 px-6 py-3 rounded-xl bg-[#4267B2]/10 text-[#4267B2] hover:bg-[#4267B2] hover:text-white transition-all duration-300 font-bold text-sm">
                                     <i class="fa fa-facebook text-lg"> </i>
                                     <span class="hidden sm:inline">Facebook </span>
                                 </a>
                                
                                 <!-- LinkedIn -->
                                 <a href="https://www.linkedin.com/shareArticle?mini=true&url=https://www.techcodeview.com/ja/how-center-text-horizontally&title=CSSのdivブロック内のテキストを(水平方向と垂直方向)中央揃えにするにはどうすればよいですか?" 
                                   target="_blank" rel="noopener noreferrer"
                                   class="flex items-center gap-2 px-6 py-3 rounded-xl bg-[#0077b5]/10 text-[#0077b5] hover:bg-[#0077b5] hover:text-white transition-all duration-300 font-bold text-sm">
                                     <i class="fa fa-linkedin text-lg"> </i>
                                     <span class="hidden sm:inline">LinkedIn </span>
                                 </a>
                              </div>
                          </div>
                     </div>
                </article>

                <!-- Comments Placeholder / Random Articles -->
                <div class="mt-8 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-6 md:p-8 shadow-sm">
                     <h3 class="text-xl font-bold text-slate-900 dark:text-white mb-6 uppercase tracking-wide border-b border-slate-200 dark:border-slate-700 pb-2">
                        あなたにおすすめ                     </h3>
                     <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                         <div class="group">
                              <a href="/ja/bresenhams-line-algorithm" class="block aspect-video rounded-lg overflow-hidden bg-slate-200 dark:bg-slate-700 mb-3">
                                 <img loading="lazy" src="https://techcodeview.com/img/computer-graphics/90/bresenhams-line-algorithm.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="ブレゼンハムの直線アルゴリズム" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                              </a>
                              <h4 class="font-bold text-slate-900 dark:text-white leading-tight group-hover:text-tech-500 transition-colors">
                                 <a href="/ja/bresenhams-line-algorithm">ブレゼンハムの直線アルゴリズム </a>
                              </h4>
                         </div> <div class="group">
                              <a href="/ja/how-get-all-unique-values-javascript-array" class="block aspect-video rounded-lg overflow-hidden bg-slate-200 dark:bg-slate-700 mb-3">
                                 <img loading="lazy" src="https://techcodeview.com/img/javascript-array/50/how-get-all-unique-values-javascript-array.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="JavaScript 配列内のすべての一意の値を取得 (重複を削除) するにはどうすればよいですか?" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                              </a>
                              <h4 class="font-bold text-slate-900 dark:text-white leading-tight group-hover:text-tech-500 transition-colors">
                                 <a href="/ja/how-get-all-unique-values-javascript-array">JavaScript 配列内のすべての一意の値を取得 (重複を削除) するにはどうすればよいですか? </a>
                              </h4>
                         </div>
                     </div>
                </div>
             </div>

             <!-- SECONDARY COLUMN (SIDEBAR) -->
             <!-- Aside Column -->
 <div class="lg:col-span-4 space-y-8">
	
	 <!-- Best Articles Widget -->
	 <div class="rounded-xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 p-6 shadow-sm">
		 <div class="mb-4 border-b border-slate-100 dark:border-slate-700 pb-2">
			 <h2 class="text-lg font-bold text-slate-900 dark:text-white uppercase tracking-wide flex items-center">
                 <span class="mr-2 h-2 w-2 rounded-full bg-tech-500"> </span>
                トップ記事             </h2>
		 </div>
		
		 <!-- Owl Carousel Preserved Container -->
		 <div id="owl-carousel-3" class="owl-carousel owl-theme center-owl-nav">
			 <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/quantum-numbers">
						 <img src="https://techcodeview.com/img/atoms-ions/95/quantum-numbers.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="量子数" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/quantum-numbers" class="hover:text-tech-500 transition-colors line-clamp-3">量子数 </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/how-open-tif-tiff-files-android">
						 <img src="https://techcodeview.com/img/android-tutorial/06/how-open-tif-tiff-files-android.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Android で TIF または TIFF ファイルを開く方法" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/how-open-tif-tiff-files-android" class="hover:text-tech-500 transition-colors line-clamp-3">Android で TIF または TIFF ファイルを開く方法 </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/verilog-case-statement">
						 <img src="https://techcodeview.com/img/verilog-tutorial/34/verilog-case-statement.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Verilog ケース ステートメント" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/verilog-case-statement" class="hover:text-tech-500 transition-colors line-clamp-3">Verilog ケース ステートメント </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/when-did-windows-7-come-out">
						 <img src="https://techcodeview.com/img/windows-tutorial/94/when-did-windows-7-come-out.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Windows 7 はいつ登場しましたか?" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/when-did-windows-7-come-out" class="hover:text-tech-500 transition-colors line-clamp-3">Windows 7 はいつ登場しましたか? </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/segmentation-fault-core-dumped-ubuntu">
						 <img src="https://techcodeview.com/img/linux-tutorial/90/segmentation-fault-core-dumped-ubuntu.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="セグメンテーション違反でコアがダンプされた Ubuntu" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/segmentation-fault-core-dumped-ubuntu" class="hover:text-tech-500 transition-colors line-clamp-3">セグメンテーション違反でコアがダンプされた Ubuntu </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/linux-locate-command">
						 <img src="https://techcodeview.com/img/linux-unix-tools/46/linux-locate-command.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Linuxのlocateコマンド" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/linux-locate-command" class="hover:text-tech-500 transition-colors line-clamp-3">Linuxのlocateコマンド </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/what-is-nginx">
						 <img src="https://techcodeview.com/img/nginx-tutorial/68/what-is-nginx.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="NGINXとは何ですか?" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/what-is-nginx" class="hover:text-tech-500 transition-colors line-clamp-3">NGINXとは何ですか? </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/ultimate-guide-mcdonald-s-breakfast-131440">
						 <img src="https://techcodeview.com/img/blog/89/ultimate-guide-mcdonald-s-breakfast.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="マクドナルドの朝食究極ガイド: 何を注文するか" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/ultimate-guide-mcdonald-s-breakfast-131440" class="hover:text-tech-500 transition-colors line-clamp-3">マクドナルドの朝食究極ガイド: 何を注文するか </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/what-is-dijkstra-s-algorithm">
						 <img src="https://techcodeview.com/img/dijkstra/58/what-is-dijkstra-s-algorithm.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="ダイクストラのアルゴリズムとは何ですか? |ダイクストラの最短経路アルゴリズムの概要" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/what-is-dijkstra-s-algorithm" class="hover:text-tech-500 transition-colors line-clamp-3">ダイクストラのアルゴリズムとは何ですか? |ダイクストラの最短経路アルゴリズムの概要 </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/ja/minimum-number-of-deletions-to-make-a-sorted-sequence">
						 <img src="https://techcodeview.com/img/dynamic-programming/32/minimum-number-of-deletions-to-make-a-sorted-sequence.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="ソートされたシーケンスを作成するための最小削除数" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/ja/minimum-number-of-deletions-to-make-a-sorted-sequence" class="hover:text-tech-500 transition-colors line-clamp-3">ソートされたシーケンスを作成するための最小削除数 </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE -->
		 </div>
		

         <!-- Categories -->
		 <div class="mt-8 mb-4 border-b border-slate-100 dark:border-slate-700 pb-2">
			 <h2 class="text-lg font-bold text-slate-900 dark:text-white uppercase tracking-wide">カテゴリ </h2>
		 </div>
		 <div class="flex flex-wrap gap-2">
             <a href="/ja/blog/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                ブログ
             </a> <a href="/ja/java-conversion/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Java変換
             </a> <a href="/ja/maths/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                数学
             </a> <a href="/ja/java-collections/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Java コレクション
             </a> <a href="/ja/differences/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                違い
             </a> <a href="/ja/java-string/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Java文字列
             </a>
         </div>

         <!-- Interesting Articles Widget -->
		 <div class="mt-8">
			 <div class="mb-4 border-b border-slate-100 dark:border-slate-700 pb-2">
				 <h2 class="text-lg font-bold text-slate-900 dark:text-white uppercase tracking-wide">興味深い記事 </h2>
			 </div>
			
			 <div id="owl-carousel-4" class="owl-carousel owl-theme">
				 <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/blog/28/harvard-acceptance-letter.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="ハーバード大学の合格通知: 本物と公式" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/ja/blog/">ブログ </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/ja/harvard-acceptance-letter-1311338">ハーバード大学の合格通知: 本物と公式 </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/php-tutorial/82/php-variables.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="PHP の $ 変数と $$ 変数" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/ja/php-tutorial/">Php チュートリアル </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/ja/php-variables">PHP の $ 変数と $$ 変数 </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/java-tutorial/81/types-classes-java.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Javaのクラスの種類" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/ja/java-tutorial/">Java チュートリアル </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/ja/types-classes-java">Javaのクラスの種類 </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/algebra/99/inequalities.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="不平等" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/ja/algebra/">代数 </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/ja/inequalities">不平等 </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/css-tutorial/25/css-transition-opacity.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="CSS トランジションの不透明度" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/ja/css-tutorial/">Css チュートリアル </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/ja/css-transition-opacity">CSS トランジションの不透明度 </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/blog/51/complete-list-ib-courses.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="IB コースとクラスの完全なリスト" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/ja/blog/">ブログ </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/ja/complete-list-ib-courses-131826">IB コースとクラスの完全なリスト </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE -->
			 </div>
		 </div>
	 </div>
 </div>
 <!-- /Aside Column -->         </div>
        </div>
     </div>

 <footer class="site-footer">
         <div class="container">
             <span class="footer-links">
                Copyright ©2026 全著作権所有 | 
                 <a href="//www.techcodeview.com/cs/">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>
	 <script>
    !function(){"use strict";let t=document.createElement("button");t.id="toTopBtn",t.innerHTML="↑";let e=`
        #toTopBtn {
            position: fixed; bottom: 25px; right: 25px; z-index: 9999; opacity: 0; visibility: hidden; background-color: #0ea5e9; color: white; border: none; border-radius: 8px; width: 50px; height: 50px; font-size: 24px; cursor: pointer; transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        }
        #toTopBtn:hover { background-color: #0284c7; }
    `,i=document.createElement("style");i.type="text/css",i.innerText=e,document.head.appendChild(i),document.body.appendChild(t),window.addEventListener("scroll",()=>{let e=window.scrollY||document.documentElement.scrollTop;e>300?(t.style.opacity="1",t.style.visibility="visible"):(t.style.opacity="0",t.style.visibility="hidden")}),t.addEventListener("click",()=>{window.scrollTo({top:0,behavior:"smooth"})})}();
     </script>
 </body>
 </html>