Update snippets

This commit is contained in:
Angelos Chalaris
2020-04-20 13:05:10 +03:00
parent 2d1f637692
commit d35dab24c3
10 changed files with 43 additions and 89 deletions

View File

@ -6,24 +6,33 @@ tags: visual,interactivity,intermediate
Changes the appearance of a form if any of its children are focused.
```html
<div class="focus-within">
<form>
<label for="given_name">Given Name:</label> <input id="given_name" type="text" /> <br />
<label for="family_name">Family Name:</label> <input id="family_name" type="text" />
</form>
</div>
<form>
<label for="username">Username:</label>
<input id="username" type="text" />
<br />
<label for="password">Password:</label>
<input id="password" type="text" />
</form>
```
```css
form {
border: 3px solid #2d98da;
color: #000000;
padding: 4px;
border: 2px solid #52B882;
padding: 8px;
border-radius: 2px;
}
form:focus-within {
background: #f7b731;
color: #000000;
background: #7CF0BD;
}
label {
display: inline-block;
width: 72px;
}
input {
margin: 4px;
}
```