:default CSS 疑似クラス

HTML

<form>
 
<p><input type="submit" id="submit1" value="はい" /></p><p><input type="submit" id="submit2" value="いいえ" /></p>

<p><input type="checkbox" id="cbox1" value="first_checkbox"><label for="cbox2">This is the first checkbox</label></p>
<p><input type="checkbox" id="cbox2" value="second_checkbox" checked="checked"><label for="cbox2">This is the second checkbox, which is checked</label></p>

<select>
 <option value="volvo">Volvo</option>
 <option value="saab">Saab</option>
 <option value="mercedes">Mercedes</option>
 <option value="audi" selected>Audi</option>
</select>

</form>

CSS

:default +label , :default {
 background-color: lime;
}
input[type="submit"]:focus, input[type="checkbox"]:checked + label{
 background:yellow;
}

Can I Use css-default-pseudo? Data on support for the css-default-pseudo feature across the major browsers from caniuse.com.


新着記事

コメントは受け付けていません。