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/_colon_default/index.html | 111 +++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 files/ja/web/css/_colon_default/index.html (limited to 'files/ja/web/css/_colon_default/index.html') diff --git a/files/ja/web/css/_colon_default/index.html b/files/ja/web/css/_colon_default/index.html new file mode 100644 index 0000000000..528bbd7d80 --- /dev/null +++ b/files/ja/web/css/_colon_default/index.html @@ -0,0 +1,111 @@ +--- +title: ':default' +slug: 'Web/CSS/:default' +tags: + - CSS + - CSS 基本ユーザーインターフェイス + - Layout + - Pseudo-class + - Reference + - Web + - セレクター + - 疑似クラス +translation_of: 'Web/CSS/:default' +--- +
{{CSSRef}}
+ +

:defaultCSS擬似クラスで、関連する要素のグループ内で既定となっているフォーム上の要素を選択します。

+ +

このセレクターが何に一致するかについては、 HTML Standard §4.16.3 Pseudo-classes で定義されています。 — {{htmlelement("button")}}、 <input type="checkbox"><input type="radio">、 {{htmlelement("option")}} 要素に一致させることができます。

+ + + +

構文

+ +
{{csssyntax}}
+
+ +

+ +

HTML

+ +
<fieldset>
+  <legend>Favorite season</legend>
+
+  <input type="radio" name="season" id="spring">
+  <label for="spring">Spring</label>
+
+  <input type="radio" name="season" id="summer" checked>
+  <label for="summer">Summer</label>
+
+  <input type="radio" name="season" id="fall">
+  <label for="fall">Fall</label>
+
+  <input type="radio" name="season" id="winter">
+  <label for="winter">Winter</label>
+</fieldset>
+
+ +

CSS

+ +
input:default {
+  box-shadow: 0 0 2px 1px coral;
+}
+
+input:default + label {
+  color: coral;
+}
+
+ +

結果

+ +

{{EmbedLiveSample("Examples")}}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#selector-default', ':default')}}{{Spec2('HTML WHATWG')}}変更なし。
{{SpecName('HTML5 W3C', '#selector-default', ':default')}}{{Spec2('HTML5 W3C')}}HTML に関する意味付けと制約検証を定義。
{{SpecName('CSS4 Selectors', '#default-pseudo', ':default')}}{{Spec2('CSS4 Selectors')}}変更なし。
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("css.selectors.default")}}

+ +

関連情報

+ + +
-- cgit v1.2.3-54-g00ecf