Added basic styling.
This commit is contained in:
parent
29d903d070
commit
90cd3b7a46
3 changed files with 81 additions and 0 deletions
43
css/02-input-textarea-label.css
Normal file
43
css/02-input-textarea-label.css
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
.fieldwrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fieldwrapper label {
|
||||
position: absolute;
|
||||
font-size: 1em;
|
||||
left: 2ch;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.fieldwrapper input:focus ~ label,
|
||||
.fieldwrapper input:not(:placeholder-shown) ~ label,
|
||||
.fieldwrapper textarea:focus ~ label,
|
||||
.fieldwrapper textarea:not(:placeholder-shown) ~ label {
|
||||
left: auto;
|
||||
right: 1ch;
|
||||
top: -.4em;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
input, textarea {
|
||||
width: 100%;
|
||||
border: none;
|
||||
}
|
||||
|
||||
input:invalid, textarea:invalid {
|
||||
box-shadow: 0 0 .2em #f00;
|
||||
}
|
||||
|
||||
input:valid, textarea:valid {
|
||||
box-shadow: 0 0 .2em #0f0;
|
||||
}
|
||||
|
||||
input, img#captcha {
|
||||
height: 2em;
|
||||
}
|
||||
|
||||
textarea {
|
||||
height: var(--textarea-height);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue