I want to apply style to top menu <ul>
,<li>
and <a>
tags and different style to body menu <ul>
,<li>
and <a>
tags .
how it is possible.
in short i want different style for ul li and a tags for top menu and different style for ui li and a tags for body menu code for top menu
答案 0 :(得分:1)
您需要为菜单/项目分配类或ID以区分它们,然后在CSS中设置类/ ID的样式。示例HTML:
<ul id="top-menu">
<li>
<a>Item 1</a>
</li>
<li>
<a>Item 2</a>
</li>
</ul>
<ul class="body-menu">
<li>
<a>Item 1</a>
</li>
<li>
<a>Item 2</a>
</li>
</ul>
CSS:
ul#top-menu {
STYLES
}
#top-menu > li {
STYLES
}
#top-menu > li > a {
STYLES
}
ul.body-menu {
STYLES
}
ul.body-menu > li {
STYLES
}
ul.body-menu > li > a {
STYLES
}