Created
November 19, 2021 11:21
-
-
Save portapipe/ed344bfcc9eec4b0a73c052a8cc51330 to your computer and use it in GitHub Desktop.
CompactFormFields for Bootstrap - HTML Select with label inside the top of the field itself
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.compact-formfields > .form-label{ | |
padding-top: 5px; | |
font-weight: 100; | |
margin-bottom: -10px !important; | |
background-color: white !important; | |
height: 42px; | |
width: 100%; | |
border: 1px solid #ddd; | |
padding-left: 11px; | |
border-bottom: none; | |
border-top-left-radius: 4px !important; | |
border-top-right-radius: 4px !important; | |
} | |
.compact-formfields > input, | |
.compact-formfields > textarea{ | |
border-top: none !important; | |
margin-top: -5px; | |
border-top-left-radius: 0px !important; | |
border-top-right-radius: 0px !important; | |
} | |
.compact-formfields > select{ | |
margin-top: -5px; | |
} | |
.compact-formfields > input:focus, | |
.compact-formfields > select:focus, | |
.compact-formfields > textarea:focus, | |
.compact-formfields > button:focus { | |
outline: none !important; | |
outline-color: transparent !important; | |
outline-style: none !important; | |
box-shadow: none !important; | |
border-color: #ddd !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- SELECT FIELD --> | |
<div class='compact-formfields'> | |
<label for='field1' class="form-label">Field 1</label> | |
<select name='field1' class="form-select"> | |
<option>Option 1</option> | |
<option>Option 2</option> | |
<option>Option 3</option> | |
</select> | |
</div> | |
<!-- TEXT INPUT FIELD --> | |
<div class='compact-formfields'> | |
<label for='field2' class='form-label'>Field 2</label> | |
<input type='text' class='form-control' id='field2' name='field2'> | |
</div> | |
<!-- TEXTAREA INPUT FIELD --> | |
<div class='compact-formfields'> | |
<label for="field3" class="form-label">Field 3</label> | |
<textarea class="form-control" id="field3" name="field3" placeholder="Type your message"></textarea> | |
</div> |
Author
portapipe
commented
Nov 19, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment