From 0ed7c371f7ff103e19b2474e8a55c02d77e3c74d Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sat, 16 Oct 2021 23:48:25 +0900 Subject: CSS 基本ユーザーインターフェイスの文書を更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/10/15 時点の英語版に同期 --- files/ja/web/css/outline-style/index.md | 292 ++++++++++++++++---------------- 1 file changed, 144 insertions(+), 148 deletions(-) (limited to 'files/ja/web/css/outline-style/index.md') diff --git a/files/ja/web/css/outline-style/index.md b/files/ja/web/css/outline-style/index.md index 63fe79ad38..364d1bb098 100644 --- a/files/ja/web/css/outline-style/index.md +++ b/files/ja/web/css/outline-style/index.md @@ -3,26 +3,25 @@ title: outline-style slug: Web/CSS/outline-style tags: - CSS - - CSS プロパティ - CSS 輪郭線 - - Outline + - CSS プロパティ - Reference - - outline-style + - recipe:css-property +browser-compat: css.properties.outline-style translation_of: Web/CSS/outline-style --- -
{{CSSRef}}
+{{CSSRef}} -

CSS の outline-style プロパティは、要素の輪郭線のスタイルを設定します。輪郭線とは要素の周りに描かれる線のことで、 {{cssxref("border")}} よりも外側です。

+CSS の **`outline-style`** プロパティは、要素の輪郭線のスタイルを設定します。輪郭線とは要素の周りに描かれる線のことで、 {{cssxref("border")}} よりも外側です。 -
{{EmbedInteractiveExample("pages/css/outline-style.html")}}
+{{EmbedInteractiveExample("pages/css/outline-style.html")}} - +たいていの場合、輪郭線の見た目を定義するときは一括指定プロパティ {{cssxref("outline")}} を使ったほうが便利です。 -

たいていの場合、輪郭線の見た目を定義するときは一括指定プロパティ {{cssxref("outline")}} を使ったほうが便利です。

+## 構文 -

構文

- -
/* キーワード値 */
+```css
+/* キーワード値 */
 outline-style: auto;
 outline-style: none;
 outline-style: dotted;
@@ -37,96 +36,88 @@ outline-style: outset;
 /* グローバル値 */
 outline-style: inherit;
 outline-style: initial;
+outline-style: revert;
 outline-style: unset;
-
- -

outline-style プロパティは、以下に挙げた値のうちの一つで指定します。

- -

- -
-
-

auto

-
-
ユーザーエージェントに輪郭線の描画を任せます。
-
-

none

-
-
輪郭線を描きません。{{cssxref("outline-width")}} は 0 です。
-
-

dotted

-
-
点線の輪郭線です。
-
-

dashed

-
-
破線の輪郭線です。
-
-

solid

-
-
1本の実線の輪郭線です。
-
-

double

-
-
2本の実線の輪郭線です。{{cssxref("outline-width")}}は2本の線とその隙間の合計です。
-
-

groove

-
-
ページに刻まれたかのように見える輪郭線です。
-
-

ridge

-
-
grooveの逆で、ページから押し出されたように見える輪郭線です。
-
-

inset

-
-
領域がページに埋め込まれたかのように見える輪郭線です。
-
-

outset

-
-
insetの逆で、領域がページから隆起しているように見える輪郭線です。
-
- -

形式文法

+``` + +`outline-style` プロパティは、以下に挙げた値のうちの一つで指定します。 + +### 値 + +- `auto` + - : ユーザーエージェントに輪郭線の描画を任せます。 +- `none` + - : 輪郭線を描きません。{{cssxref("outline-width")}} は `0` です。 +- `dotted` + - : 点線の輪郭線です。 +- `dashed` + - : 破線の輪郭線です。 +- `solid` + - : 1 本の実線の輪郭線です。 +- `double` + - : 2 本の実線の輪郭線です。{{cssxref("outline-width")}} は 2 本の線とその隙間の合計です。 +- `groove` + - : ページに刻まれたかのように見える輪郭線です。 +- `ridge` + - : `groove` の逆で、ページから押し出されたように見える輪郭線です。 +- `inset` + - : 領域がページに埋め込まれたかのように見える輪郭線です。 +- `outset` + - : `inset` の逆で、領域がページから隆起しているように見える輪郭線です。 + +## 公式定義 + +{{cssinfo}} + +## 形式文法 {{csssyntax}} -

+## 例 -

例 0 - auto

+

輪郭線のスタイルを auto に設定

-

autoは、輪郭線スタイルがカスタムであることを表します。 — 典型的には、プラットフォーム用のユーザーインターフェースのデフォルトのスタイル、または、CSSで詳細に記述できるスタイルよりも表現豊かなスタイル(例:輝いて見える半透明の外郭を持つ、輪郭の丸い輪郭線)

+`auto` の値は、輪郭線のスタイルが独自のものであることを表します。[仕様書](https://www.w3.org/TR/css-ui-3/#outline-style)によれば、「典型的には、プラットフォーム用のユーザーインターフェイスの既定のスタイル、または、CSS で詳細に記述できるスタイルよりも表現豊かなスタイル 、例えば、輝いて見える半透明の外郭を持つ、輪郭の丸い輪郭線」となっています。 -

HTML

+#### HTML -
<div>
-  <p class="auto">Outline Demo</p>
-</div> 
+```html +
+

Outline Demo

+
+``` -

CSS

+#### CSS -
.auto {
-  outline-style: auto; /* "outline: auto" と同じ */
+```css
+.auto {
+  outline-style: auto; /* same result as "outline: auto" */
 }
 
 /* デモを見やすく */
-* { outline-width: 10px; padding: 15px; } 
+* { outline-width: 10px; padding: 15px; } +``` + +#### 結果 -

{{ EmbedLiveSample('Example_0_-_auto') }}

+{{ EmbedLiveSample('Setting_outline_style_to_auto') }} -

例 1 - dotteddashed

+

輪郭線を dashed と dotted に設定

-

HTML

+#### HTML -
<div>
-  <div class="dotted">
-    <p class="dashed">Outline Demo</p>
-  </div>
-</div> 
+```html +
+
+

Outline Demo

+
+
+``` -

CSS

+#### CSS -
.dotted {
+```css
+.dotted {
   outline-style: dotted; /* "outline: dotted" と同じ */
 }
 .dashed {
@@ -134,23 +125,29 @@ outline-style: unset;
 }
 
 /* デモを見やすく */
-* { outline-width: 10px; padding: 15px; } 
+* { outline-width: 10px; padding: 15px; } +``` -

{{ EmbedLiveSample('Example_1_-_dotted_and_dashed') }}

+#### 結果 -

例 2 - soliddouble

+{{ EmbedLiveSample('Setting_outline_style_to_dashed_and_dotted') }} -

HTML

+

輪郭線のスタイルを solid と double に設定

-
<div>
-  <div class="solid">
-    <p class="double">Outline Demo</p>
-  </div>
-</div> 
+#### HTML -

CSS

+```html +
+
+

Outline Demo

+
+
+``` -
.solid {
+#### CSS
+
+```css
+.solid {
   outline-style: solid;
 }
 .double {
@@ -158,23 +155,29 @@ outline-style: unset;
 }
 
 /* デモを見やすく */
-* { outline-width: 10px; padding: 15px; } 
+* { outline-width: 10px; padding: 15px; } +``` + +#### 結果 -

{{ EmbedLiveSample('Example_2_-_solid_and_double') }}

+{{ EmbedLiveSample('Setting_outline_style_to_solid_and_double') }} -

例 3 - grooveridge

+

輪郭線のスタイルを groove と ridge に設定

-

HTML

+#### HTML -
<div>
-  <div class="groove">
-    <p class="ridge">Outline Demo</p>
-  </div>
-</div>
+```html +
+
+

Outline Demo

+
+
+``` -

CSS

+#### CSS -
.groove {
+```css
+.groove {
   outline-style: groove;
 }
 .ridge {
@@ -182,23 +185,29 @@ outline-style: unset;
 }
 
 /* デモを見やすく */
-* { outline-width: 10px; padding: 15px; }
+* { outline-width: 10px; padding: 15px; } +``` -

{{ EmbedLiveSample('Example_3_-_groove_and_ridge') }}

+#### 結果 -

例 4 - insetoutset

+{{ EmbedLiveSample('Setting_outline_style_to_groove_and_ridge') }} -

HTML

+

輪郭線のスタイルを inset と outset に設定

-
<div>
-  <div class="inset">
-    <p class="outset">Outline Demo</p>
-  </div>
-</div>
+#### HTML -

CSS

+```html +
+
+

Outline Demo

+
+
+``` -
.inset {
+#### CSS
+
+```css
+.inset {
   outline-style: inset;
 }
 .outset {
@@ -206,36 +215,23 @@ outline-style: unset;
 }
 
 /* デモを見やすく */
-* { outline-width: 10px; padding: 15px; }
- -

{{ EmbedLiveSample('Example_4_-_inset_and_outset') }}

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Basic UI', '#outline-style', 'outline-style')}}{{Spec2('CSS3 Basic UI')}}auto値を追加。
{{SpecName('CSS2.1', 'ui.html#propdef-outline-style', 'outline-style')}}{{Spec2('CSS2.1')}}初回定義
- -

{{cssinfo}}

- -

ブラウザーの対応

- -

{{Compat("css.properties.outline-style")}}

+* { outline-width: 10px; padding: 15px; } +``` + +#### 結果 + +{{ EmbedLiveSample('Setting_outline_style_to_inset_and_outset') }} + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- {{cssxref("outline")}} +- {{cssxref("outline-color")}} +- {{cssxref("outline-width")}} -- cgit v1.2.3-54-g00ecf