I've a span as a label for my inputfield. The label goes above the input field when selected.
My problem is that when you try to click on the input field, the label is 'in front' of the inputfield and blocks you from selecting it.
I tried fixing it using z-indexes but this doesn't seem to work.
Can somebody help me with getting the input field in front of the span?
#input {
color: #686868;
vertical-align: middle;
padding: 0px !important;
font-size: 16px;
border-width: 0;
overflow: visible;
box-shadow: none;
border: none;
border-bottom: 1px solid #d5dce3;
background-color: transparent !important;
}
#input:focus {
border-color: #1F76BC;
}
#label {
color: rgba(0,0,0,.99);
transition-timing-function: cubic-bezier(.075,.82,.165,1);
transition-duration: .5s;
position: absolute;
width: 100%;
text-align: left;
font-size: 16px;
bottom: 6px;
color: #8792a1;
}
.container:focus-within #label {
transform: translate3d(0,-26px,0);
color: rgba(0,0,0,.99);
}
.container {
position: relative;
margin-top: 32px;
}
<div class="container">
<span id="label">Provincie</span>
<input type="text" id="input" value="" size="40">
</div>
Use label instead of span and your input will be well clickable, regardless of the location of the placeholder
input = document.querySelector("#input");
label = document.querySelector(".container > label");
input.addEventListener("change", function () {
if (this.value !== "") {
label.style.transform = "translate3d(0, -26px, 0)";
} else {
label.style.transform = "";
}
});
#input {
color: #686868;
vertical-align: middle;
padding: 0px !important;
font-size: 16px;
border-width: 0;
overflow: visible;
box-shadow: none;
border: none;
border-bottom: 1px solid #d5dce3;
background-color: transparent !important;
}
#input:focus {
border-color: #1f76bc;
}
label {
color: rgba(0, 0, 0, 0.99);
transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1);
transition-duration: 0.5s;
position: absolute;
width: 100%;
text-align: left;
font-size: 16px;
bottom: 6px;
color: #8792a1;
}
.container:focus-within label {
transform: translate3d(0, -26px, 0);
color: rgba(0, 0, 0, 0.99);
}
.container {
position: relative;
margin-top: 32px;
}
<div class="container">
<label for="input">Provincie</label>
<input type="text" id="input" value="" size="40" />
</div>
please add this style.
#input{
position:relative;
z-index:999;
}
#input {
color: #686868;
vertical-align: middle;
padding: 0px !important;
font-size: 16px;
border-width: 0;
overflow: visible;
box-shadow: none;
border: none;
border-bottom: 1px solid #d5dce3;
background-color: transparent !important;
position:relative;
z-index:999;
}
#input:focus {
border-color: #1F76BC;
}
#label {
color: rgba(0,0,0,.99);
transition-timing-function: cubic-bezier(.075,.82,.165,1);
transition-duration: .5s;
position: absolute;
width: 100%;
text-align: left;
font-size: 16px;
bottom: 6px;
color: #8792a1;
}
.container:focus-within #label {
transform: translate3d(0,-26px,0);
color: rgba(0,0,0,.99);
}
.container {
position: relative;
margin-top: 32px;
}
<div class="container">
<span id="label">Provincie</span>
<input type="text" id="input" value="" size="40">
</div>
Something like this??
#input {
color: #686868;
vertical-align: middle;
padding: 0px !important;
font-size: 16px;
border-width: 0;
overflow: visible;
box-shadow: none;
border: none;
border-bottom: 1px solid #d5dce3;
background-color: transparent !important;
}
#input:focus {
border-color: #1F76BC;
}
#label {
color: rgba(0, 0, 0, .99);
transition-timing-function: cubic-bezier(.075, .82, .165, 1);
transition-duration: .5s;
position: absolute;
width: 100%;
text-align: left;
font-size: 16px;
bottom: 6px;
color: #8792a1;
}
.container:focus-within #label {
transform: translate3d(0, -26px, 0);
color: rgba(0, 0, 0, .99);
}
.container {
position: relative;
margin-top: 32px;
}
<div class="container">
<input type="text" id="input" value="" size="40" placeholder="Provincie">
</div>
Related
I need help with the Select Dropdown. It moves the content (Hello World) when opened. I have used Radio Input to select the specfic option when performing a Search. If there is any other better solution for this type of functionality, please assist.
HTML
<span class="dropdown-el">
<input type="radio" name="sortType" value="Relevance" checked="checked" id="sort-relevance"><label for="sort-relevance">Relevance</label>
<input type="radio" name="sortType" value="Popularity" id="sort-best"><label for="sort-best">Product Popularity</label>
<input type="radio" name="sortType" value="PriceIncreasing" id="sort-low"><label for="sort-low">Price Low to High</label>
<input type="radio" name="sortType" value="PriceDecreasing" id="sort-high"><label for="sort-high">Price High to Low</label>
<input type="radio" name="sortType" value="ProductBrand" id="sort-brand"><label for="sort-brand">Product Brand</label>
<input type="radio" name="sortType" value="ProductName" id="sort-name"><label for="sort-name">Product Name</label>
</span>
<h1> Hello World</h1>
CSS
body {
text-align: center;
background: #ebf4fb;
min-height: 95vh;
margin: 0;
padding: 0;
border-bottom: 5vh solid #3694d7;
font-family: "Myriad Pro", "Arial", sans;
font-size: 24px;
}
.dropdown-el {
margin-top: 20vh;
min-width: 12em;
position: relative;
display: inline-block;
margin-right: 1em;
min-height: 2em;
max-height: 2em;
overflow: hidden;
top: 0.5em;
cursor: pointer;
text-align: left;
white-space: nowrap;
color: #444;
outline: none;
border: 0.06em solid transparent;
border-radius: 1em;
background-color: #cde4f5;
transition: 0.3s all ease-in-out;
}
.dropdown-el input:focus + label {
background: #def;
}
.dropdown-el input {
width: 1px;
height: 1px;
display: inline-block;
position: absolute;
opacity: 0.01;
}
.dropdown-el label {
border-top: 0.06em solid #d9d9d9;
display: block;
height: 2em;
line-height: 2em;
padding-left: 1em;
padding-right: 3em;
cursor: pointer;
position: relative;
transition: 0.3s color ease-in-out;
}
.dropdown-el label:nth-child(2) {
margin-top: 2em;
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el input:checked + label {
display: block;
border-top: none;
position: absolute;
top: 0;
width: 100%;
}
.dropdown-el input:checked + label:nth-child(2) {
margin-top: 0;
position: relative;
}
.dropdown-el::after {
content: "";
position: absolute;
right: 0.8em;
top: 0.9em;
border: 0.3em solid #3694d7;
border-color: #3694d7 transparent transparent transparent;
transition: 0.4s all ease-in-out;
}
.dropdown-el.expanded {
border: 0.06em solid #3694d7;
background: #fff;
border-radius: 0.25em;
padding: 0;
box-shadow: rgba(0, 0, 0, 0.1) 3px 3px 5px 0px;
max-height: 15em;
}
.dropdown-el.expanded label {
border-top: 0.06em solid #d9d9d9;
}
.dropdown-el.expanded label:hover {
color: #3694d7;
}
.dropdown-el.expanded input:checked + label {
color: #3694d7;
}
.dropdown-el.expanded::after {
transform: rotate(-180deg);
top: 0.55em;
}
JQuery
$('.dropdown-el').click(function(e) {
e.preventDefault();
e.stopPropagation();
$(this).toggleClass('expanded');
$('#'+$(e.target).attr('for')).prop('checked',true);
});
$(document).click(function() {
$('.dropdown-el').removeClass('expanded');
});
https://codepen.io/libsys/pen/bGKomaE
Please assist.
I want to create a custom button for a file upload in a form using simple html and css.
Here is my code.
.upload-btn-wrapper {
position: relative;
overflow: hidden;
display: inline-block;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="upload-btn-wrapper">
<button class="btn">Upload a file<i style="font-size:18px" class="fa"></i></button>
<input type="file" name="myfile" />
</div>
if it is just about to design upload button cutomly then this css code is also usefull.
Here is your css
and open the snippet to check.
.upload_field input.wpcf7-file::-webkit-file-upload-button {
border: none;
color: #fff;
font-weight: 500;
background: linear-gradient(90deg, rgba(35,90,75,8) 0%, rgb(33, 169, 99) 35%, rgba(39,203,119,1) 100%);
padding: 4px 18px;
border-radius: 30px;
cursor: pointer;
box-shadow: 2px 1px 9px -3px #25c171;
}
.upload_field input.wpcf7-file::-webkit-file-upload-button:hover {
background: linear-gradient(90deg, rgba(39,203,119,1) 0%, rgba(39,203,119,1) 35%, rgba(14,90,51,1) 100%);
}
.upload_field input.wpcf7-file::-webkit-file-upload-button:focus{
outline:none;
}
.upload_field input.wpcf7-file:focus {
outline: none;
}
.upload_field {
margin-bottom: 20px;
padding-left: 5px;
border: 1px solid #e6e6e6;
padding: 15px 10px 25px;
border-radius: 20px;
}
<div class="upload_field">
<label>Please Upload Your Resume(jpg,png, pdf, doc).<br>
<span class="wpcf7-form-control-wrap file-874"><input type="file" name="file-874" size="40" class="wpcf7-form-control wpcf7-file" accept=".jpg,.png,.pdf,.doc" aria-invalid="false"></span></label>
</div>
.upload-btn-wrapper {
position: relative;
overflow: hidden;
display: inline-block;
}
.fa {
margin-left: 10px;
padding: 10px;
background: white;
color : #0e5a33;
border-radius: 50%;
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.btn {
border: 2px solid #0e5a33;
background-color: #0e5a33;
box-shadow: 8px 8px 18px 0px rgba(84, 181, 119, 0.3) !important;
font-size: 18px;
padding: 5px 5px 5px 28px;
border-radius: 25px;
color: white;
}
.btn:before{
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
opacity: 1;
-webkit-transform: translate(-105%, 0);
transform: translate(-105%, 0);
background-color: rgba(255, 255, 255, 0.8);
}
.btn:hover:before{
opacity: 0;
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.upload-btn-wrapper input[type=file] {
font-size: 100px;
position: absolute;
left: 0;
top: 0;
opacity: 0;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="upload-btn-wrapper">
<button class="btn">Upload a file<i style="font-size:18px" class="fa"></i></button>
<input type="file" name="myfile" />
</div>
<!DOCTYPE html>
<html>
<head>
<style>
.button {
display: inline-block;
border-radius: 4px;
background-color: #f4511e;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 28px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
</style>
</head>
<body>
<h2>Animated Button</h2>
<button class="button" style="vertical-align:middle"><span>Upload File </span>
</button>
</body>
</html>
I want to have the textfield just like gmail has right now. I mean when we focus on the text field, the label or placeholder goes to the top exactly at the top border line of its text field with no border line on the background of the label only. I tried but could not make it happen and i found the code in internet which did not work either. Here is what the code is
.FieldWrapper input[type="text"] {
box-sizing: border-box;
width: 100%;
height: calc(3em + 2px);
margin: 0 0 1em;
padding: 1em;
border: 1px solid #ccc;
background: #fff;
resize: none;
outline: none;
}
.FieldWrapper input[type="text"]:focus {
border-color: #00bafa;
}
.FieldWrapper input[type="text"]:focus+label[placeholder]:before {
color: #00bafa;
}
.FieldWrapper input[type="text"]:focus+label[placeholder]:before,
.FieldWrapper input[type="text"]:valid+label[placeholder]:before {
transition-duration: 0.2s;
-webkit-transform: translate(0, -1.5em) scale(0.9, 0.9);
transform: translate(0, -1.5em) scale(0.9, 0.9);
}
.FieldWrapper input[type="text"]:invalid+label[placeholder][alt]:before {
content: attr(alt);
}
.FieldWrapper input[type="text"]+label[placeholder] {
display: block;
pointer-events: none;
line-height: 1.25em;
margin-top: calc(-1em - 2px);
margin-bottom: calc((3em - 1em) + 2px);
}
.FieldWrapper input[type="text"]+label[placeholder]:before {
content: attr(placeholder);
display: inline-block;
margin: 0 calc(1em + 2px);
padding: 0 2px;
color: #898989;
white-space: nowrap;
transition: 0.3s ease-in-out;
background-image: linear-gradient(to bottom, #fff, #fff);
background-size: 100% 5px;
background-repeat: no-repeat;
background-position: center;
}
<div class="FieldWrapper">
<input type='text' name="name" />
<label alt="field name" placeholder="field name" />
</div>
This is what exactly i was expecting
Try this:
.input-container {
position: relative;
font-family: Arial;
}
.input-container input {
height: 32px;
line-height: 24px;
border-radius: 8px;
border: 1px solid #dcdcdc;
min-width: 300px;
padding: 4px 8px;
transition: all .2s ease;
}
.input-container label {
position: absolute;
top: 12px;
left: 4px;
background-color: #fff;
padding: 0 4px;
font-size: 14px;
pointer-events: none;
transition: all .2s ease;
}
.input-container input:focus {
outline: none;
border: 1px solid #3f51b5;
}
.input-container input:valid + label,
.input-container input:focus + label {
top: -8px;
color: #3f51b5;
}
<div class="input-container">
<input id="my-input" type="text" required>
<label for="my-input">My input label</label>
</div>
I have a toggle animation here: https://codepen.io/7harrypotterrr/pen/OrBwPY but don't know how to actually apply it onto my code and replace existing toggle button here: https://codepen.io/7harrypotterrr/pen/ebPKjZ
.toggle-box {
display: none;
}
.toggle-box + label {
cursor: pointer;
display: block;
font-weight: bold;
line-height: 21px;
margin-bottom: 5px;
}
.toggle-box + label + div {
display: none;
margin-bottom: 10px;
}
.toggle-box:checked + label + div {
display: block;
}
.toggle-box + label:before {
background-color: #4F5150;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
color: #FFFFFF;
content: "+";
display: block;
float: left;
font-weight: bold;
height: 20px;
line-height: 20px;
margin-right: 5px;
text-align: center;
width: 20px;
}
.toggle-box:checked + label:before {
content: "\2212";
}
.checkbox:hover {
color: #0da1ec !important;
}
label:hover {
color: pink;
}
<div id="page">
<input class="toggle-box" id="identifier-1" type="checkbox">
<label for="identifier-1">test</label>
<div>test</div>
<input class="toggle-box" id="identifier-2" type="checkbox">
<label for="identifier-2">test</label>
<div>test</div>
</div>
Any help would be very much appreciated. Thanks!
You can disregard your current CSS and apply the CSS in the first CodePen to achieve the styling you want.
You'll also need to remove the div after each label, and replace 'test' with <i></i>.
label {
display: block;
width: 54px;
height: 32px;
margin: 0px auto;
border-radius: 100px;
transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
background-color: #E6E9EC;
}
input {
display: none;
}
/* The toggle */
i {
height: 28px;
width: 28px;
background: #ffffff;
display: inline-block;
border-radius: 100px;
margin-top: 2px;
margin-left: 2px;
transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
pointer-events: none;
box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
}
label:hover>i {
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.20);
transform: scale(1.01);
}
input:checked+label>i {
margin-left: 24px;
}
label:active {
background-color: #A6B9CB;
}
label:active>i {
width: 34px;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.20);
}
input:checked+label:active>i {
margin-left: 18px;
}
input:checked+label {
background-color: #008FFF;
}
<div id="page">
<input class="toggle-box" id="identifier-1" type="checkbox">
<label for="identifier-1"><i></i></label>
<input class="toggle-box" id="identifier-2" type="checkbox">
<label for="identifier-2"><i></i></label>
</div>
The following css code should achieve what you want if you structure the HTML as per the snippet.
.toggly + label + div {
display: none;
margin-bottom: 10px;
}
.toggly:checked + label + div {
display: block;
}
label {
display: block;
width: 54px;
height: 32px;
margin: 0px auto;
border-radius: 100px;
transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
background-color: #E6E9EC;
}
input {
display: none;
}
/* The toggle */
i {
height: 28px;
width: 28px;
background: #ffffff;
display: inline-block;
border-radius: 100px;
margin-top: 2px;
margin-left: 2px;
transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
pointer-events: none;
box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
}
label:hover>i {
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.20);
transform: scale(1.01);
}
input:checked+label>i {
margin-left: 24px;
}
label:active {
background-color: #A6B9CB;
}
label:active>i {
width: 34px;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.20);
}
input:checked+label:active>i {
margin-left: 18px;
}
input:checked+label {
background-color: #008FFF;
}
.toggly + label + div {
display: none;
margin-bottom: 10px;
}
.toggly:checked + label + div {
display: block;
}
<input type="checkbox" id="toggly" class="toggly">
<label for="toggly"><i></i></label>
<div>Test</test>
Based on some code I found, I was able to make a kind of select menu with CSS only.
But now I have a problem with overlaying divs. It means, all divs below that "select menu" are moving down on hover or click that menu.
I've tried to play with z-index and positioning without success. I believe its quite simple but I'm seeing this code for many hours that I'm going crazy.
body {
width: 100%;
min-height: 500px;
margin: 3em auto;
font-family: 'Roboto', sans-serif;
letter-spacing: 1px;
}
h1 {
text-align: center;
color: #fff;
font-weight: 300;
font-size: 50px;
font-family: ProximaNovaSoftW03-Semibold;
letter-spacing: 0px;
text-shadow: 1px 1px rgba(0, 0, 0, 0.02), 2px 2px rgba(0, 0, 0, 0.02), 3px 3px rgba(0, 0, 0, 0.02), 4px 4px rgba(0, 0, 0, 0.02), 5px 5px rgba(0, 0, 0, 0.02), 6px 6px rgba(0, 0, 0, 0.02), 7px 7px rgba(0, 0, 0, 0.02);
}
h1 i {
position: relative;
font-size: 70px;
}
p {
text-align: center;
color: #000;
font-size: 14px;
margin-bottom: 2em;
line-height: 30px;
}
p img {
position: relative;
top: 8px;
right: 10px;
}
.paragrafo {
width: 100%;
background-color: #e1e1e1;
position: fixed;
}
.reserve-select {
position: relative;
overflow: hidden;
display: block;
margin: auto;
width: 330px;
height: 100%;
border-bottom: 0px;
border-radius: 3px;
font-size: 12px;
box-shadow: 0px 1em 1em -1.5em rgba(0, 0, 0, 0.5);
border: 1px solid rgba(0, 0, 0, 0.05);
}
.reserve-select:not(:hover)>i.toggle.icon-arrow-down {
display: block !important;
}
.reserve-select:not(:hover)>i.toggle.icon-arrow-up {
display: none !important;
}
.reserve-select:not(:hover) label.option>input:not(:checked)~span.title {
display: none !important;
}
.reserve-select>i.toggle {
position: absolute;
z-index: 4;
right: 1.5em;
top: 1.6em;
color: #ccc;
}
.reserve-select .title,
.reserve-select .placeholder {
position: relative;
display: block;
width: 100%;
height: 100%;
padding: 1.5em 2em;
background: white;
border-top: 1px solid rgba(0, 0, 0, 0.05);
cursor: pointer;
}
.reserve-select>input {
position: absolute;
left: 0px;
top: 0px;
z-index: 1;
width: 100%;
height: 100%;
display: block;
opacity: 0;
cursor: pointer;
}
.reserve-select>input:checked~i.toggle.icon-arrow-down {
display: none;
}
.reserve-select>input:checked~i.toggle.icon-arrow-up {
display: block;
}
.reserve-select>input:checked div.options label.option .title {
display: none !important;
}
.reserve-select>input:not(:checked) {
z-index: 4;
}
.reserve-select>input:not(:checked)~label.option>span.title {
display: none;
}
.reserve-select>input:not(:checked)~i.toggle.icon-arrow-up {
display: none;
}
.reserve-select>input:not(:checked)~i.toggle.icon-arrow-down {
display: block;
}
.reserve-select>input:disabled {
cursor: no-drop;
}
.reserve-select>span.placeholder {
position: relative;
z-index: 0;
display: inline-block;
width: 100%;
color: #999;
border-top: 0px;
}
.reserve-select label.option {
display: block;
overflow: hidden;
z-index: 1;
width: 100%;
transition: all 1s ease-out;
}
.reserve-select label.option span.title {
position: relative;
z-index: 2;
transition: background .3s ease-out;
}
.reserve-select label.option span.title i.icon {
padding-right: 8px;
color: #92a8d1;
}
.reserve-select label.option span.title:hover {
color: white;
background: #3498db;
box-shadow: inset 0px 1px 0px rgba(0, 0, 0, 0.1);
}
.reserve-select label.option input {
display: none;
}
.reserve-select label.option input:checked~span.title {
position: absolute;
display: block;
z-index: 3;
top: 0px;
font-size: 12px;
background: #fff;
border-top: 0px;
box-shadow: none;
color: inherit;
width: 100%;
}
.reserve-select label.option input:disabled~span.title {
background: #f9f9f9 !important;
color: #aaa;
}
.reserve-select label.option input:disabled~span.title:hover {
color: #aaa;
background: none;
cursor: no-drop;
}
<div class="reserve-select">
<input type="radio" name="option">
<span class="placeholder">Choose...</span>
<label class="option">
<input type="radio" name="option">
<span class="title">Speedometer</span>
</label>
<label class="option">
<input type="radio" name="option">
<span class="title">Fire</span>
</label>
<label class="option">
<input type="radio" name="option">
<span class="title">Badge</span>
</label>
</div>
<div class="paragrafo">
<p>Teste</p>
</div>
LINK: https://jsfiddle.net/o2gxgz9r/13580/
try this.Wrap options in a div and give position absolute for that div
body {
width: 100%;
min-height: 500px;
margin: 3em auto;
background: white;
/* IE6-9 fallback on horizontal gradient */
font-family: 'Roboto', sans-serif;
letter-spacing: 1px;
}
h1 {
text-align: center;
color: #fff;
font-weight: 300;
font-size: 50px;
font-family: ProximaNovaSoftW03-Semibold;
letter-spacing: 0px;
text-shadow: 1px 1px rgba(0, 0, 0, 0.02), 2px 2px rgba(0, 0, 0, 0.02), 3px 3px rgba(0, 0, 0, 0.02), 4px 4px rgba(0, 0, 0, 0.02), 5px 5px rgba(0, 0, 0, 0.02), 6px 6px rgba(0, 0, 0, 0.02), 7px 7px rgba(0, 0, 0, 0.02);
}
h1 i {
position: relative;
font-size: 70px;
}
p {
text-align: center;
color: #000;
font-size: 14px;
margin-bottom: 2em;
line-height: 30px;
}
p img {
position: relative;
top: 8px;
right: 10px;
}
.paragrafo {
width:100%;
background-color: #e1e1e1;
z-index: 1;
}
.reserve-select {
position: relative;
//overflow: hidden;
display: block;
margin: auto;
width: 330px;
height: 100%;
border-bottom: 0px;
border-radius: 3px;
font-size: 12px;
box-shadow: 0px 1em 1em -1.5em rgba(0, 0, 0, 0.5);
border: 1px solid rgba(0, 0, 0, 0.05);
}
.reserve-select:not(:hover) > i.toggle.icon-arrow-down {
display: block !important;
}
.reserve-select:not(:hover) > i.toggle.icon-arrow-up {
display: none !important;
}
.reserve-select:not(:hover) label.option > input:not(:checked) ~ span.title {
display: none !important;
}
.reserve-select > i.toggle {
position: absolute;
z-index: 4;
right: 1.5em;
top: 1.6em;
color: #ccc;
}
.reserve-select .title,
.reserve-select .placeholder {
position: relative;
display: block;
width: 100%;
height: 100%;
padding: 1.5em 2em;
background: white;
border-top: 1px solid rgba(0, 0, 0, 0.05);
cursor: pointer;
}
.reserve-select > input {
position: absolute;
left: 0px;
top: 0px;
z-index: 1;
width: 100%;
height: 100%;
display: block;
opacity: 0;
cursor: pointer;
}
.reserve-select > input:checked ~ i.toggle.icon-arrow-down {
display: none;
}
.reserve-select > input:checked ~ i.toggle.icon-arrow-up {
display: block;
}
.reserve-select > input:checked div.options label.option .title {
display: none !important;
}
.reserve-select > input:not(:checked) {
z-index: 4;
}
.reserve-select > input:not(:checked) ~ label.option > span.title {
display: none;
}
.reserve-select > input:not(:checked) ~ i.toggle.icon-arrow-up {
display: none;
}
.reserve-select > input:not(:checked) ~ i.toggle.icon-arrow-down {
display: block;
}
.reserve-select > input:disabled {
cursor: no-drop;
}
.reserve-select > span.placeholder {
position: relative;
z-index: 0;
display: inline-block;
width: 100%;
color: #999;
border-top: 0px;
}
.reserve-select label.option {
display: block;
overflow: hidden;
z-index: 1;
width: 100%;
transition: all 1s ease-out;
}
.reserve-select label.option span.title {
position: relative;
z-index: 2;
transition: background .3s ease-out;
}
.reserve-select label.option span.title i.icon {
padding-right: 8px;
color: #92a8d1;
}
.reserve-select label.option span.title:hover {
color: white;
background: #3498db;
box-shadow: inset 0px 1px 0px rgba(0, 0, 0, 0.1);
}
.reserve-select label.option input {
display: none;
}
.reserve-select label.option input:checked ~ span.title {
position: absolute;
display: block;
z-index: 3;
top: 0px;
font-size: 12px;
background: #fff;
border-top: 0px;
box-shadow: none;
color: inherit;
width: 100%;
}
.reserve-select label.option input:disabled ~ span.title {
background: #f9f9f9 !important;
color: #aaa;
}
.reserve-select label.option input:disabled ~ span.title:hover {
color: #aaa;
background: none;
cursor: no-drop;
}
.options{
position:absolute;
top:50px;
width:100%;
}
<body>
<div class="reserve-select">
<input type="radio" name="option">
<span class="placeholder">Choose...</span>
<div class="options">
<label class="option">
<input type="radio" name="option">
<span class="title">Speedometer</span>
</label>
<label class="option">
<input type="radio" name="option">
<span class="title">Fire</span>
</label>
<label class="option">
<input type="radio" name="option">
<span class="title">Badge</span>
</label>
</div>
</div>
<div class="paragrafo">
<p>Teste</p>
</div>