<div class="cp_ipselect07">
<input type="radio" name="option">
<i class="toggle cp_sl07_arrowdown"></i>
<i class="toggle cp_sl07_arrowup"></i>
<span class="cp_sl07_selectlabel">Choose</span>
<label class="option">
<input type="radio" name="option">
<span class="cp_sl07_title">cat</span>
</label>
<label class="option">
<input type="radio" name="option">
<span class="cp_sl07_title">dog</span>
</label>
<label class="option">
<input type="radio" name="option">
<span class="cp_sl07_title">rabbit</span>
</label>
<label class="option">
<input type="radio" name="option">
<span class="cp_sl07_title">squirrel</span>
</label>
</div>
.cp_ipselect07 {
position: relative;
display: block;
overflow: hidden;
width: 100%;
margin: 2em auto;
}
/*ラジオボタンの制御*/
.cp_ipselect07 > input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
display: block;
width: 100%;
height: 56px;
cursor: pointer;
opacity: 0;
}
.cp_ipselect07 label.option input {
display: none;
}
.cp_ipselect07 > i.toggle {
position: absolute;
z-index: 4;
top: 1.6em;
right: 1.5em;
color: #ffffff;
}
/*プルダウンの三角を設定*/
.cp_ipselect07 .cp_sl07_arrowup:before {
position: absolute;
top: 0;
right: 0;
content: '';
width: 16px;
height: 8px;
background: #ffffff;
clip-path: polygon(0 100%, 100% 100%, 50% 0);
transition: all 250ms cubic-bezier(.4,.25,.3,1);
}
.cp_ipselect07 .cp_sl07_arrowdown:before {
position: absolute;
top: 0;
right: 0;
content: '';
width: 16px;
height: 8px;
background: #ffffff;
clip-path: polygon(0 0, 100% 0, 50% 100%);
transition: all 250ms cubic-bezier(.4,.25,.3,1);
}
.cp_ipselect07 .cp_sl07_title,
.cp_ipselect07 .cp_sl07_selectlabel {
position: relative;
display: block;
width: 100%;
height: 100%;
cursor: pointer;
border-top: 1px solid rgba(0, 0, 0, 0.05);
background: #da3c41;
}
/*ラジオボタンにチェックが入っていない時の処理*/
.cp_ipselect07 > input:not(:checked) {
z-index: 4;
}
.cp_ipselect07 > input:not(:checked) ~ label.option > span.cp_sl07_title {
display: none;
}
.cp_ipselect07 > input:not(:checked) ~ i.toggle.cp_sl07_arrowup {
display: none;
}
.cp_ipselect07 > input:not(:checked) ~ i.toggle.cp_sl07_arrowdown {
display: block;
}
/*ラジオボタンにチェックが入った時の処理*/
.cp_ipselect07 > input:checked ~ i.toggle.cp_sl07_arrowdown {
display: none;
}
.cp_ipselect07 > input:checked ~ i.toggle.cp_sl07_arrowup {
display: block;
}
.cp_ipselect07 > input:checked div.options label.option .cp_sl07_title {
display: none !important;
}
.cp_ipselect07 label.option input:checked ~ span.cp_sl07_title {
position: absolute;
z-index: 3;
top: 0;
display: flex;
align-items: center;
width: 100%;
height: 56px;
color: inherit;
border-top: 0;
background: #1b2538;
}
/*セレクト内テキストの設定*/
.cp_ipselect07 > span.cp_sl07_selectlabel,
.cp_ipselect07 label.option {
display: flex;
align-items: center;
width: 100%;
height: 56px;
color: #ffffff;
border-top: 0;
transition: all 1s ease-out;
}
.cp_ipselect07 > span.cp_sl07_selectlabel {
padding-left: 1em;
}
.cp_ipselect07 label.option span.cp_sl07_title {
position: relative;
display: flex;
align-items: center;
padding-left: 2em;
height: 56px;
z-index: 2;
transition: 0.3s ease-out;
}
.cp_ipselect07 label.option span.cp_sl07_title:hover {
color: #ffffff;
background: #1b2538;
}