-2
我想添加一个下拉选项(子菜单)到现有的菜单栏。添加一个下拉菜单(子菜单)到现有的菜单
这是我的CSS和HTML代码。
我发现了很多下拉菜单。 但对我来说非常重要的是,我只是想将新功能添加到我的现有菜单中,而不会对整个菜单做任何更改。
/* Add a black background color to the top navigation */
.topnav {
background-color: #333;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
\t float: left;
\t display: block;
\t color: #f2f2f2;
\t text-align: right;
\t padding: 14px 16px;
\t text-decoration: none;
\t font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #4CAF50;
color: white;
}
<div class="topnav" id="myTopnav">
<a href="#news">Speed Dial</a>
<a href="#news">Speed Dial</a>
你尝试过什么,什么是不工作?如果它对你“非常重要”,那么你肯定已经在某处做了一些努力。 – David
请提供更多关于您的要求的信息。 –
@SarinJacobSunny,我只是想添加下拉菜单到菜单中的一些元素。 – Serbon