diff --git a/floating-labels.css b/floating-labels.css new file mode 100644 index 0000000..326d9e5 --- /dev/null +++ b/floating-labels.css @@ -0,0 +1,66 @@ +:root { + --input-padding-x: .75rem; + --input-padding-y: .7rem; +} +.form-label-group { + position: relative; + margin-bottom: 1rem; +} +.form-label-group label { + margin: 0; +} + +.form-label-group input, +.form-label-group textarea, +.form-label-group label { + padding: var(--input-padding-y) var(--input-padding-x); +} + +.form-label-group label { + position: absolute; + top: 50%; + left: 0; + display: block; + width: 100%; + margin-bottom: 0; /* Override default `