■ ヒントだよ!HTML & CSS ■
■ CSS focus-within の例
- CSS
- form:focus-within { background-color: yellow; }
- html
form:focus-within {
background-color: yellow;
<form action="sample.cgi" method="post">
お客様情報<br>
<label for="name">お名前</label>
<input type="text" name="name" id="name" value=""><br>
<br>
<label for="address">ご住所</label>
<input type="text" name="address" id="address" value=""><br>
<br>
<input type="submit" name="submit" value="送信">
</form>
© KinutaHandicraft