Split Button Dropdown
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="STYLESHEET" type="text/css" href="web.css">
<title>web design</title>
</head>
<body>
<h1>Split Button Dropdown</h1>
<p>Move the mouse over the arrow icon to open the dropdown menu.
</p>
<button class="btn">Button</button>
<div class="drop">
<button class="btn" style="border-left:1px solid #0b8bf2 ;"><i class="fa fa-caret-down"></i></button>
<div class="down">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
</body>
</html>
CSS Split Button Dropdown Style
.btn{
background-color: #2196f3;
color:white;
padding:16px;
font-size:16px;
border: none;
outline: none;
}
.drop{
position: absolute;
display: inline-block;
}
.down{
display: none;
position: absolute;
background-color: #f1f1f1;
min-width:160px;
z-index:1 ;
}
.down a{
color: #000;
padding:12px 16px;
text-decoration: none;
display: block;
}
.down a:hover{
background-color: #ddd;
}
.drop:hover .down{
display: block;
}
.btn:hover .drop:hover .btn{
background-color: #0b7dda;
}
No comments:
Post a Comment