CSS
 Computer >> コンピューター >  >> プログラミング >> CSS

CSSを使用して下の境界線のスタイルを設定します


下の境界線のスタイルを設定するには、border-bottom-styleプロパティを使用します。設定できる境界線の値は、点線、二重、破線、実線などです。

次のコードを実行して、下の境界線のスタイルを設定できます

<!DOCTYPE html>
<html>
   <head>
      <style>
         p.dotted {border-bottom-style: dotted;}
         p.double {border-bottom-style: double;}
         p.dashed {border-bottom-style: dashed;}
         p.solid {border-bottom-style: solid;}
         p.inset {border-bottom-style: inset;}
         p.outset {border-bottom-style: outset;}
      </style>
   </head>
   <body>
      <p class = "dotted">Dotted bottom border.</p>
      <p class = "double">Double bottom border.</p>
      <p class = "dashed">Dashed bottom border.</p>
      <p class = "solid">Solid bottom border.</p>
      <p class = "inset">Inset bottom border.</p>
      <p class = "outset">Outset bottom border.</p>
   </body>
</html>

出力

CSSを使用して下の境界線のスタイルを設定します


  1. CSSを使用して境界線を作成およびスタイル設定する方法は?

    要素の境界線を定義し、CSSを使用してスタイルを設定できます。 CSS borderプロパティは、要素のborderプロパティを定義するために使用されます。これは、border-width、border-style、border-colorの省略形です。さらに、画像を境界線として指定できます。 構文 CSSボーダープロパティの構文は次のとおりです- Selector {    border: /*value*/ } 例 次の例は、CSSボーダープロパティ-を示しています。 <!DOCTYPE html> <html> <head> &

  2. CSSのborderShorthandプロパティ

    borderプロパティは、要素のborderプロパティを定義するために使用されます。これは、border-width、border-style、border-colorの省略形です。 構文 CSSボーダープロパティの構文は次のとおりです- Selector {    border: /*value*/ } 例 次の例は、CSSボーダープロパティ-を示しています。 <!DOCTYPE html> <html> <head> <style> img {    margin-top: 14px;