运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .dropbtn { background-color: #3498DB; color: white; padding: 16px; font-size: 16px; border: none; } .dropup { position: relative; display: inline-block; } .dropup-content { display: none; position: absolute; background-color: #f1f1f1; min-width: 160px; bottom: 50px; z-index: 1; } .dropup-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropup-content a:hover {background-color: #ccc} .dropup:hover .dropup-content { display: block; } .dropup:hover .dropbtn { background-color: #2980B9; } </style> </head> <body style="background-color:white;"> <h2>Hoverable Dropup</h2> <p>Example text...</p> <p>Example text...</p> <p>Move the mouse over the button to open the dropup menu.</p> <div class="dropup"> <button class="dropbtn">Dropup</button> <div class="dropup-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </div> </body> </html>