java - 如何使用java将项目添加到dropup html/css
问题描述
我有图像,当你将鼠标悬停在它们上面时,会出现一个下拉菜单。我想在网站底部添加一个按钮,将用户输入项添加到下拉菜单。
我曾尝试使用 addTo 但我不知道如何使用它来下拉。
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.dropup-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
bottom: 50px;
z-index: 1;
height: 132px;
overflow: auto;
}
.dropup-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropup:hover .dropup-content {
display: block;
}
</style>
</head>
<body>
<div class="dropup">
<img src="https://i.imgur.com/5mXfwr1.jpg">
<div class="dropup-content">
<a href="http://www.echoecho.com/htmltext03.htm"target="_blank">PF thing 1</a>
<a href="#">PF thing 2</a>
<a href="#">PF thing 3</a>
</div>
</div>
</body>
</html>
我基于此示例的代码。它按预期工作,但我需要对其进行修改,以便您可以在单击按钮时添加项目。
解决方案
推荐阅读
- javascript - 使用 event.target.id 时抛出的类型“EventTarget”上不存在属性“id”
- java - Spring Boot:从服务器错误接收时如何解析 Content-Type
- python - WinError 2 - os.path.getmtime 没有在 Python 3 中定位文件
- javascript - AMAZON Lex 配置中缺少凭据
- c# - 通过命令行工具基于Service.svcmap生成文件
- ios - 根据滚动视图上的内容增加表格视图高度
- bash - 根据指定的特定员工的 UNIX 平均值
- excel - 循环工作表并根据工作表名称插入公式
- excel - 将 excel 数据(某些单元格包含图片)转换为 PowerPoint 幻灯片
- vb.net - 如何使用不同的查询字符串多次重定向到同一页面?