logo

CSSフォントの枠線

CSS フォントの境界線 を作成するために使用されるテクニックです。 境界線のような輪郭 HTML テキスト文字の周り。このテクニックは、文字の視認性を高めたり、装飾的な効果を加えるために使用されます。これは、テキストストロークプロパティを使用して実現できます。このプロパティを使用すると、テキストの周囲に境界線を追加して、テキストの外観をカスタマイズできます。

CSSでフォント枠を適用する方法

HTML のテキスト要素にフォント境界線を適用するには、次の 2 つの方法があります。

目次



これらの CSS プロパティを詳しく調べて、HTML にテキストの境界線を配置するためにそれらがどのように使用されるかを理解しましょう。

text-shadow プロパティの使用

Text-Shadow プロパティ CSS では、テキストに影の効果を追加し、深みと強調を与えます。水平および垂直オフセット、ぼかし半径、および色のパラメータを取得するため、デザイナーはさまざまなテキストシャドウ効果を作成して視覚的な魅力を向上させることができます。

構文:

text-shadow: h-shadow v-shadow blur-radius color;>

プロパティ値 :

text-shadow プロパティは多くの値を受け入れます。その一部を以下の表に示します。

プロパティ値説明
h-shadow>テキストの周囲に水平方向の影を設定します。
v-shadow>テキストの周囲に垂直方向の影を設定します。
blur-radius>テキストシャドウの周囲のぼかし半径を設定します。
color>文字の影の色を設定します。
none>テキストの周囲には何も設定しません(影なし)。
initial>テキストの影をデフォルトの初期値に設定します。
inherit>親要素からプロパティ値を継承します。

戻り値:

テキストの周囲のフォント境界線/影を返します。

フォント枠の例

例 1: この例では、text-shadow プロパティを使用してテキストに影を作成します。

html
   CSS text-shadow プロパティ title><style>h1 { text-shadow: 0 0 3px #FF0000, 0 0 5px #0000FF;スタイル>頭> <body> <h1>techcodeview.comh1> 本文> html>>></pre> </code> <p dir='ltr'>  <b>  <strong>出力:</strong>  </b>  <span> </span></p>  <img src='//techcodeview.com/img/picked/01/css-font-border.webp' alt="テキストシャドウCSS"><p dir='ltr'>  <b>  <strong>例 2:</strong>  </b>  <span>この例では、text-shadow プロパティを使用して枠付きテキストを作成します。</span></p>html<code class='hljs'> <pre class='hljs'><!DOCTYPE html> <html> <head> <title>CSS text-shadow プロパティ title><!-- Style to use text-shadow property --> <style>.GFG { 色: 白;フォントサイズ: 50px;テキストシャドウ: -1px 1px 0 #000、1px 1px 0 #000、1px -1px 0 #000、-1px -1px 0 #000;スタイル>頭> <body> <p>techcodeview.comp> body> html>>></pre> </code> <p dir='ltr'>  <b>  <strong>出力:</strong>  </b>  </p>  <img src='//techcodeview.com/img/picked/01/css-font-border-2.webp' alt="枠付きテキストCSS"><h2 id='using-textstroke-property'>  <b>  <strong>テキストストロークプロパティの使用</strong>  </b>  </h2><p dir='ltr'><span>の</span> <span>Text-Stroke プロパティ</span> <span>テキストにストロークを追加するために使用されます。このプロパティを使用して、テキストの幅と色を変更できます。このプロパティは、-webkit- プレフィックスを使用することでサポートされます。</span></p> <p dir='ltr'>  <b>  <strong>構文:</strong>  </b>  </p> <pre class='hljs'>-webkit-text-stroke: width color;></pre><h3>  <b>  <strong>例</strong>  </b>  </h3><p dir='ltr'><span>この例では、text-ストローク プロパティを使用して枠付きテキストを作成します。</span></p>html<code class='hljs'> <pre class='hljs'><!DOCTYPE html> <html> <head> <title>CSS テキストストロークプロパティ title><!-- Style to use text-stroke property --> <style>.GFG { 色: 白;フォントサイズ: 50px; -webkit-text-ストローク幅: 1px; -webkit-text-ストロークの色: 黒;スタイル>頭> <body> <p>techcodeview.comp> body> html>>></pre> </code> <p dir='ltr'>  <b>  <strong>出力:</strong>  </b>  <span> </span></p>  <img src='//techcodeview.com/img/picked/01/css-font-border-3.webp' alt=""><p dir='ltr'>  <b>  <strong>サポートされているブラウザ:</strong>  </b>  </p> <ul><li value='1'> <span>グーグルクローム</span> <span>1</span></li><li value='2'> <span>角</span> <span> </span> <span>12</span></li><li value='3'> <span>Firefox</span> <span>1</span></li><li value='4'> <span>オペラ</span> <span>3.5</span></li><li value='5'> <span>サファリ</span> <span>1</span></li></ul><p dir='ltr'><span>CSS は Web ページの基礎であり、Web サイトや Web アプリのスタイルを設定することで Web ページ開発に使用されます。これに従って、CSS を基礎から学ぶことができます。</span> <span>CSS チュートリアル</span> <span>そして</span> <span>CSS の例</span> <span>。</span></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="/instagram/">インスタグラム</a> </li><li> <a href="/binary-representation/">バイナリ表現</a> </li><li> <a href="/dbms/">Dbms</a> </li><li> <a href="/chemistry/">化学</a> </li><li> <a href="/excel-charts/">Excel グラフ</a> </li><li> <a href="/quotes/">引用</a> </li><li> <a href="/microprocessor-tutorial/">マイクロプロセッサのチュートリアル</a> </li><li> <a href="/cyber-defence-intelligence/">サイバー防御インテリジェンス</a> </li><li> <a href="/java-object-oriented/">Java オブジェクト指向</a> </li><li> <a href="/cpp-iterator/">Cpp-イテレーター</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">元学級委員長が語る生徒選挙の勝ち方</h2>
                        <div class="content">
                            <div class="item">
                                 <blockquote class="quote">                                  
                                    <span> <i class="fa fa-quote-left"></i> 生徒会選挙での勝利を目指していますか?元学級委員長が、学校で指導的な役割に昇進する方法を説明します。</span>
                                </blockquote>                
                                                                                             
                            </div><!--//item-->
                            
                            <p> <a class="more-link" href="/how-win-student-election-1311424"> <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="/informatica-powercenter">Informatica PowerCenter</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/wc-command-linux-with-examples">Linux の wc コマンドと例</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/is-california-time-zone-pst">カリフォルニアのタイムゾーンは PST、PDT、または PT ですか?</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/means-ends-analysis-artificial-intelligence">人工知能における手段目的分析</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/5-apps-social-networks-teens-love-242128">10 代の若者が好む 5 つのアプリとソーシャル ネットワーク</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="/javabean">ジャワビーン</a>
</li><li><a href="/typescript-foreach">typescript の foreach ループ</a>
</li><li><a href="/how-sort-tuple-python">Pythonソートタプル</a>
</li><li><a href="/selenium-tutorial">セレンのチュートリアル</a>
</li><li><a href="/java-swing-tutorial">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="//ko.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>
	<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: #213141;
            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: #555;
        }
    `,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>