简体   繁体   English

如何在导航菜单中的活动菜单上设置边框

[英]how to make a border on active menu in the navigation menu

hi i'm attaching part of my css code containing the menu part. 嗨,我要附加我的CSS代码的一部分,其中包含菜单部分。

#menuwrap {
float:left;
width:861px;
height:50px;
background:#ff284d;
padding:0 0 0 120px;
}
 ul.nav {
list-style:none;
float:left;
font-family: 'Carrois Gothic SC', sans-serif;
margin:21px 0 0 0;
}
 ul.nav li{
list-style:none;
float:left;
font-family: 'Carrois Gothic SC', sans-serif;
font-size:14px;
text-transform:uppercase;
font-weight:bold;
color:#fff;
padding-right:15px;
}
   ul.nav li a{
color:#fff;
text-decoration:none;

    }

i need to show a different colour box when an item is clicked. 单击某个项目时,我需要显示一个不同的颜色框。 where should i change the code? 我应该在哪里更改代码?

Edit:: i just need to show the navigation.for that anything just an arrow or a box or border or underline etc. 编辑::我只需要显示navigation.for任何东西只是箭头或框或边框或下划线等。

I believe that is WordPress. 我相信那是WordPress。 Your CSS will look something like this (but I need your url to provide you with proper CSS - this is just a rough code): 您的CSS看起来像这样(但是我需要您的URL为您提供正确的CSS-这只是一个粗略的代码):

    ul.nav li.current-menu-item a{
    border: 1px solid red; /* this is your border */

}

The .current-menu-item class is added to most WordPress temlates navigation menus by default and it is what we use to target active / selected menus. 默认情况下,.current-menu-item类添加到大多数WordPress temlates导航菜单中,这是我们用来定位活动/选定菜单的对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM