【发布时间】:2016-08-04 07:26:29
【问题描述】:
在页面中选择侧边栏菜单时如何更改菜单背景颜色?当我在不同的 html 文件(命名为 sidebar.html)中创建了这个侧边栏菜单并将该 html 文件包含在我的主页中时。这是我的代码:
Sidebar.html
<div id="menuwrapper" >
<ul>
<li>
<a href="#"><img src="image/dashboard-icon.png" id="logimg" alt="Smiley face" height="" width="">
<strong style="margin-left: 7px;"> Dashboard</strong>
<span class="glyphicon glyphicon-menu-right" style="padding-left: 113px; font-weight: bold;"></span>
</a>
</li>
<li>
<a href="#"><img src="image/em_current_openings_icon.png" id="logimg" alt="Smiley face" height="" width="">
<strong style="margin-left: 7px;font-family: sans-serif;">Curent Openings</strong>
<span class="glyphicon glyphicon-menu-right" style="padding-left: 88px; font-weight: bold;"></span>
</a>
</li>
<li>
<a href="renumeration.html"> <img src="image/em_remuneration_icon.png" id="logimg" alt="Smiley face" height="" width="">
<strong style="margin-left: 7px;font-family: sans-serif;">Remuneration</strong>
<span class="glyphicon glyphicon-menu-right" style="padding-left: 103px; font-weight: bold;"></span>
</a>
</li>
</ul>
</div>
renumeration.html
<html>
<head>
</head>
<body>
<div ng-include src="'sidebar.html'"></div>
</body>
</html>
【问题讨论】:
-
您将需要 javascript,但请先向我们展示您尝试过的内容。
-
@Pipo 实际上我不知道如何为此添加 javascript,所以我已经发布了
-
谁能帮我提前谢谢
标签: javascript jquery html css