0

我在导航之间设置了分隔符,但是,我不希望它显示在最后一个菜单项之后。

我需要编写一些javascript来解决这个问题吗?

你可以在这里看到我在说什么:gofish2o.davelaphamblog.com

<?php wp_nav_menu( 
    array(
        'theme_location'=>'header-menu',
        'after' => '<img src="'.get_bloginfo('template_url').'/images/seperator.png"/>'
    )); 
?>
4

2 回答 2

0

我刚刚为你敲了这个。

ul#main_nav li:last-child > img {display:none}

似乎工作正常?让我知道。只需将其添加到您的样式表中

于 2013-07-26T20:05:50.807 回答
0

你不应该远离 CSS3,你应该拥抱它。我们需要推动网络向前发展,而不是使用 Internet Explorer。

无论如何,这里有几种方法可以解决这个问题。

jQuery('#menu-main li:last-child img').remove();
jQuery('#menu-main li:last-child img').css({display : 'none'});

这将使用 jQuery 删除它

#menu-main li:last-child img{
     display:none;
}

这将使用 CSS 删除它

我个人只会在列表元素上创建一个边框,而不是使用图像。

于 2013-07-26T20:07:48.040 回答