From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/css/outline/index.html | 145 ++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 files/ja/web/css/outline/index.html (limited to 'files/ja/web/css/outline/index.html') diff --git a/files/ja/web/css/outline/index.html b/files/ja/web/css/outline/index.html new file mode 100644 index 0000000000..8d5b0c20e9 --- /dev/null +++ b/files/ja/web/css/outline/index.html @@ -0,0 +1,145 @@ +--- +title: outline +slug: Web/CSS/outline +tags: + - CSS + - CSS プロパティ + - CSS 基本ユーザーインターフェイス + - CSS 輪郭線 + - Layout + - Reference + - レイアウト +translation_of: Web/CSS/outline +--- +
{{CSSRef}}
+ +

outlineCSS のプロパティで、輪郭線 (outline) に関する様々なプロパティ ({{cssxref("outline-style")}}, {{cssxref("outline-width")}}, {{cssxref("outline-color")}}) を単一の宣言で設定するための一括指定です。

+ +
{{EmbedInteractiveExample("pages/css/outline.html")}}
+ + + +

他の一括指定プロパティと同様に、省略された値は初期値に設定されます。

+ +

境界線と輪郭線

+ +

境界線と輪郭線はとても似ています。しかし、輪郭線は以下の点で境界線とは異なります。

+ + + +

構文

+ +
/* 種類 */
+outline: solid;
+
+/* 色 | 種類 */
+outline: #f66 dashed;
+
+/* 種類 | 幅 */
+outline: inset thick;
+
+/* 色 | 種類 | 幅 */
+outline: green solid 3px;
+
+/* グローバル値 */
+outline: inherit;
+outline: initial;
+outline: unset;
+
+ +

outline プロパティは以下に挙げた値のうち1~3つの値で指定します。値は順不同です。

+ +
+

メモ: 多くの要素では、スタイルが定義されていないと輪郭線は表示されません。これは style の既定値が none だからです。特筆すべき例外は input 要素で、ブラウザーが既定のスタイルを与えます。

+
+ +

+ +
+
<'outline-color'>
+
輪郭線の色を設定します。未指定の場合の既定値は currentcolor です。 {{cssxref("outline-color")}} を参照してください。
+
<'outline-style'>
+
輪郭線の種類を設定します。未指定の場合の既定値は none です。 {{cssxref("outline-style")}} を参照してください。
+
<'outline-width'>
+
輪郭線の太さを設定します。未指定の場合の既定値は medium です。 {{cssxref("outline-width")}} を参照してください。
+
+ +

形式文法

+ +
{{csssyntax}}
+ +

+ +

HTML

+ +
<a href="#">このリンクは特殊なフォーカスのスタイルです。</a>
+
+ +

CSS

+ +
a {
+  border: 1px solid;
+  border-radius: 3px;
+  display: inline-block;
+  margin: 10px;
+  padding: 5px;
+}
+
+a:focus {
+  outline: 4px dotted #e73;
+  outline-offset: 4px;
+  background: #ffa;
+}
+
+ +

結果

+ +

{{EmbedLiveSample("Example", "100%", 60)}}

+ +

アクセシビリティの考慮事項

+ +

outline の値を 0 または none にすると、ブラウザーの既定のフォーカス表示を削除します。要素が操作できるものであれば、視覚的なフォーカス表示が必要です。既定のフォーカス表示を削除するのであれば、目に見える分かりやすいフォーカスのスタイル付けを提供してください。

+ + + +

仕様書

+ + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Basic UI', '#outline', 'outline')}}{{Spec2('CSS3 Basic UI')}}変更なし。
{{SpecName('CSS2.1', 'ui.html#propdef-outline', 'outline')}}{{Spec2('CSS2.1')}}初回定義
+ +
{{cssinfo}}
+ +

ブラウザーの互換性

+ +
+ + +

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

+
-- cgit v1.2.3-54-g00ecf