运行 ❯
获取您的
自有
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <style> .btn { background-color: #2196F3; color: white; padding: 16px; font-size: 16px; border: none; outline: none; } .dropdown { position: absolute; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f1f1f1; min-width: 160px; z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover {background-color: #ddd} .dropdown:hover .dropdown-content { display: block; } .btn:hover, .dropdown:hover .btn { background-color: #0b7dda; } </style> </head> <body> <h2>Split Button Dropdowns</h2> <p>Move the mouse over the arrow icon to open the dropdown menu.</p> <button class="btn">Button</button> <div class="dropdown"> <button class="btn" style="border-left:1px solid #0d8bf2"> <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </div> </body> </html>