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="/python-matrix-program/">Python行列プログラム</a> </li><li> <a href="/geometric-lines/">幾何学的な線</a> </li><li> <a href="/prolog-tutorial/">プロローグのチュートリアル</a> </li><li> <a href="/java-classes/">Javaクラス</a> </li><li> <a href="/chemistry-difference-between/">化学間の違い</a> </li><li> <a href="/ms-excel-tutorial/">Ms Excel チュートリアル</a> </li><li> <a href="/data-visualization/">データの視覚化</a> </li><li> <a href="/c-conversion-programs/">C 変換プログラム</a> </li><li> <a href="/binary-search/">二分探索</a> </li><li> <a href="/category/">カテゴリー</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">Steve Harvey 純資産 2024 (給与、不動産、ビジネス)</h2>
                        <div class="content">
                            <div class="item">
                                 <blockquote class="quote">                                  
                                    <span> <i class="fa fa-quote-left"></i> スティーブ・ハーベイの2024年の純資産は2億ドルと推定されています。彼はアメリカのコメディアンであり、実業家であり、受賞歴のある番組司会者でもあります。</span>
                                </blockquote>                
                                                                                             
                            </div><!--//item-->
                            
                            <p> <a class="more-link" href="/steve-harvey-net-worth-2024-salary"> <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="/c-program-sort-an-array-ascending-order">配列を昇順にソートする C プログラム</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/36-awesome-family-feud-questions-131118">家で遊ぶための家族間の確執に関する 36 の質問</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/how-calculate-standard-error-excel">Excelで標準誤差を計算する方法</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/cpp-string/">Cpp文字列</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/analysis-algorithms-big-notation">アルゴリズムの分析 | Big – Θ (ビッグ シータ) 表記</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="/java-convert-int-string">文字列をJavaの整数に変換</a>
</li><li><a href="/spring-boot-annotations">スプリング ブートの注釈</a>
</li><li><a href="/random-function-c">c 乱数</a>
</li><li><a href="/difference-between-centos">セントス vs レル</a>
</li><li><a href="/best-smile-world">最も美しい笑顔</a>
</li><li><a href="/how-return-an-array-java">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="//sv.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>