2011-05-09 68 views
0

我有一个WordPress主题(组合出版社)创建一个网站 - http://www.photos.robinbrittain.co.uk导航菜单,CSS,背景图像和访问过的链接

它具有工程确定一个默认工具栏菜单。我一直试图在下面添加一个作为Widget添加的“自定义”菜单,看起来与上面的完全相同,但是对于访问不同的网页,但是对于菜单中的按钮访问链接和背景图像有一些问题。不幸的是,我是一个新手。

如果我使用下面的代码; 使用我的访问链接,菜单按钮根据需要更改属性,例如。背景颜色,但他们不回复或清除,并刷新到原来的“未访问”状态,当我在其他菜单按钮随后点击(通过清除浏览器历史记录时除外):

#sidebar li{list-style:none;} 
#sidebar .widget_nav_menu a:link {color: ; background:#262626 url(images/menu_left.gif) no-repeat top left; font-size:13px; text-transform:none; font-style: italic; margin-bottom:10px; padding:8px 5px 5px 10px; height:17px; width:250px; display:block; } 
#sidebar .widget_nav_menu a:visited {color: ; background:#161616 url(images/menu_left_hover.jpg) no-repeat top left; font-size:13px; text-transform:none; font-style: italic; margin-bottom:10px; padding:8px 5px 5px 10px; height:19px; width:250px;display:block;} 
#sidebar .widget_nav_menu a:hover {color:#cccccc; background:#161616 url(images/menu_left_hover.jpg) no-repeat top left;} 
#sidebar .widget_nav_menu a:active {color:#ccc; background:#262626 url(images/menu_left.gif) no-repeat top left;} 

一位同事建议删除“ a:访问过的行发现触发问题(#sidebar .widget_nav_menu a:visited ...等)。我做到了这一点,一切工作在较新的浏览器版本,如IE 9,但在早期的版本,如IE 8,与按钮高度的整个菜单将崩溃,导航时被压扁。

我,因为试验后发现,通过包括线(完整的代码如下,在此消息的结尾): -

#sidebar .current_page_item a:visited {background:#161616 url(images/menu_left_hover.jpg) no-repeat top left; color: ; font-size:13px; text-transform:none; font-style: italic; margin-bottom:10px; padding:8px 5px 5px 10px; height:17px; width:250px; display:block} 

它所有的作品,除了背景图像菜单按钮唐在至少2个最新的浏览器上正确显示,我已经测试过:IE & Firefox。看起来他们似乎没有填充按钮的宽度。我可以删除对背景图片的引用,并且导航菜单似乎都很好用,我只是没有提供按钮圆角的图像。

因此,我现在卡住了,并欢迎任何帮助,请。如何使用按钮来获取导航菜单,以便在点击之间更改和还原属性,并正确显示背景图像。

我目前拥有的代码来代替它,我只能坚持如下: -

#sidebar li{list-style:none;} 
#sidebar .widget_nav_menu a:link {color: ; background:#262626 url(images/menu_left.gif) no-repeat top left; font-size:13px; text-transform:none; font-style: italic; margin-bottom:10px; padding:8px 5px 5px 10px; height:17px; width:250px; display:block; } 
#sidebar .widget_nav_menu a:visited {color: ; background:#161616 url(images/menu_left_hover.jpg) no-repeat top left; font-size:13px; text-transform:none; font-style: italic; margin-bottom:10px; padding:8px 5px 5px 10px; height:19px; width:250px;display:block;} 
#sidebar .current_page_item a:visited {background:#161616 url(images/menu_left_hover.jpg) no-repeat top left; color: ; font-size:13px; text-transform:none; font-style: italic; margin-bottom:10px; padding:8px 5px 5px 10px; height:17px; width:250px; display:block} 
#sidebar .widget_nav_menu a:hover {color:#cccccc; background:#161616 url(images/menu_left_hover.jpg) no-repeat top left;} 
#sidebar .widget_nav_menu a:active {color:#ccc; background:#262626 url(images/menu_left.gif) no-repeat top left;} 

感谢你了,

问候,

罗宾。

回答

1

访问链接上的背景图片实际上在最新的浏览器上不再可用,因为它带来了隐私风险。通过使用单独的背景图像,可以记录客户历史记录的信息。

+0

非常感谢您的回答。非常感激。很有意思。我会尝试一些不同的东西。问候,罗宾。 – dibdibdobs 2011-06-22 10:43:21