Add ─ Full form styling for inputs, textarea, select and checkbox | Add ─ Focus and invalid input states | Add ─ Submit and reset buttons with form-actions layout | Edit ─ Responsive form rules
This commit is contained in:
1 file changed
+83
-12
+83
-12
@@ -58,17 +58,83 @@ body #div-content {
|
||||
box-shadow: 1rem 1rem 0rem #000000;
|
||||
border-radius: 2rem;
|
||||
width: 30rem;
|
||||
label, input, textarea{
|
||||
font-family: Quicksand, sans-serif;
|
||||
color: #ffffff;
|
||||
padding: 1rem 0 1.5rem;
|
||||
|
||||
h3 {
|
||||
margin: 1rem 2rem 0.5rem;
|
||||
font-size: 1.2rem;
|
||||
border-bottom: 0.15rem dashed #834206ec;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
label, input, textarea, select {
|
||||
display: block;
|
||||
margin: 2rem;
|
||||
padding-top: 0.1rem;
|
||||
margin: 1rem 2rem 0.3rem;
|
||||
padding: 0.4rem;
|
||||
font-family: inherit;
|
||||
}
|
||||
input, textarea{
|
||||
input[type="text"], input[type="email"], textarea, select {
|
||||
background-color: #1B4056;
|
||||
color: #ffffff;
|
||||
border: 0.1rem solid #1B4056;
|
||||
border-radius: 0.3rem;
|
||||
width: calc(100% - 4rem);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
textarea{
|
||||
input[type="text"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
|
||||
outline: none;
|
||||
border-color: #834206ec;
|
||||
}
|
||||
input:invalid:not(:placeholder-shown) {
|
||||
border-color: #b34040;
|
||||
}
|
||||
textarea {
|
||||
height: 10rem;
|
||||
width: 25rem;
|
||||
resize: vertical;
|
||||
font-family: inherit;
|
||||
}
|
||||
.required {
|
||||
color: #ffb84d;
|
||||
}
|
||||
.check-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 1rem 2rem;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
.check-line input[type="checkbox"] {
|
||||
margin: 0;
|
||||
width: 1.1rem;
|
||||
height: 1.1rem;
|
||||
accent-color: #834206ec;
|
||||
cursor: pointer;
|
||||
}
|
||||
.check-line label {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.form-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.8rem;
|
||||
margin: 1.5rem 2rem 0;
|
||||
}
|
||||
input[type="submit"], input[type="reset"] {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 0.5rem 1.2rem;
|
||||
background-color: #1B4056;
|
||||
color: #ffffff;
|
||||
border: 0.1rem solid #834206ec;
|
||||
border-radius: 0.3rem;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
transition: background-color 0.2s ease-out;
|
||||
}
|
||||
input[type="submit"]:hover, input[type="reset"]:hover {
|
||||
background-color: #2a658a;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,16 +185,21 @@ body #div-content {
|
||||
width: 100%;
|
||||
max-width: 30rem;
|
||||
margin: 0 auto;
|
||||
label, input, textarea {
|
||||
margin: 1rem;
|
||||
label, input, textarea, select {
|
||||
margin-left: 1rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
textarea {
|
||||
h3 {
|
||||
margin-left: 1rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
input[type="text"], input[type="email"], textarea, select {
|
||||
width: calc(100% - 2rem);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
input {
|
||||
width: calc(100% - 2rem);
|
||||
box-sizing: border-box;
|
||||
.check-line, .form-actions {
|
||||
margin-left: 1rem;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user