, CSS.
HTML:
<div class="input-group">
<input name="search" value="" class="form-control" placeholder="Search" type="text" >
<span class="input-group-btn">
<span id="triangle-down"></span>
<button class="btn btn-default" type="submit"><span class="icon-search"></span></button>
</span>
</div>
CSS :
.input-group{
width:60%;
margin:20px;
}
.form-control{
border-radius:20px;
width:80%;
}
.input-group-btn{
width:20%;
}
.btn-default{
border-radius:20px;
background-color:#DC521F;
color:#fff;
width:100%;
position:relative;
z-index:0;
}
#triangle-down {
width: 0;
height: 0;
display:inline-block;
position:absolute;
left:-20px;
top:1px;
z-index:100;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 32px solid #DC521F;
}
A : CODEPEN
------- -------
CSS:
.hover{
border-top: 32px solid #E6E6E6 !important;
}
JS-:
$( ".input-group-btn" ).hover(
function() {
$( '.triangle-down').addClass( "hover" );
}, function() {
$( '.triangle-down' ).removeClass( "hover" );
}
);
HOVER , .
A : CODEPEN
source
share