菜单链接不改变颜色 [英] menu link to not change color

查看:84
本文介绍了菜单链接不改变颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我的所有页面顶部都有一个导航栏,带有css风格的

按钮,当悬停时会改变颜色。我对如何为页面所在的链接禁用

感到有点困惑,例如站点地图页面导航栏中的站点地图

链接,研究页面上的

导航栏的研究链接等。


css位于 http://www.TheBicyclingGuitarist.net/css/style.css


网站地图位于
http://www.TheBicyclingGuitarist.net/sitemap .htm


任何提示将不胜感激。我需要创建一个新课程吗?

用< spantags围绕相关链接,还是有更好的方法?

谢谢。

-

骑自行车的吉他手

Hello. I have a navigation bar at the top of all my pages with css-styled
buttons that change color when hovered over. I am a little confused on how
to disable that for the link that the page is on, for example, the sitemap
link in the navigation bar on the sitemap page, the studies link for the
navigation bar on the studies page, etc.

The css is at http://www.TheBicyclingGuitarist.net/css/style.css

The sitemap is at
http://www.TheBicyclingGuitarist.net/sitemap.htm

Any tips will be greatly appreciated. Do I need to make a new class and
surround the relevant link with <spantags, or is there a better way?
Thanks.

--
The Bicycling Guitarist

推荐答案



" dorayme" ; < do ************ @ optusnet.com.auwrote in message

news:do **************** ****************** @ news-vip.optusnet.com.au ...

"dorayme" <do************@optusnet.com.auwrote in message
news:do**********************************@news-vip.optusnet.com.au...

in article< ; 47 ********************** @ read.cnntp.org>,

The Bicycling Guitarist < Ch *** @ TheBicyclingGuitarist.net>

写道:
In article <47**********************@read.cnntp.org>,
"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.net>
wrote:

>你好。我的所有页面顶部都有一个导航栏,带有css样式的按钮,可以在悬停时改变颜色。我有点困惑
如何
>Hello. I have a navigation bar at the top of all my pages with css-styled
buttons that change color when hovered over. I am a little confused on
how


首先,是的,你可以把你不想要的链接分类有

悬停效果; < a class =" current" href =" ...是一种常见的

练习。然后,您可以在css中设置.current的样式。
First, yes, you can just class the link you do not want to have
hovering effects; <a class="current" href="...is a common
practice. You then style the .current how you wish in the css.


其次,你也可以没有链接,所以甚至不会出现

光标手,例如,你可能只设计李本身b
信息使文本有点不同,可能在

颜色或背景中(这是用户知道的额外方式

他们在导航条中的选项中所用的页面。


第三,(但我没有正确研究过你的网站,所以这可能不是
总的来说方便)你通常不需要保持

把class =" menu2"如果你使用#menubar li a指定一个

样式它更简洁。
Second, you can also not have the link at all so not even a
cursor hand will appear, in this case you might style just the li
itself to fit in with the real links in style. It is common and
informational to have the text a little different, perhaps in
colour or background (this is an extra way for users to know
which page they are on out of the choices in the navigation strip.

Third, (but I have not studied your site properly so this may not
be convenient on the whole) you don''t generally need to keep
putting class="menu2" if you use #menubar li a to specify a
style. It is briefer.



感谢您的帮助,Dorayme。

我到目前为止遵循了第一个建议,但我打算实施

第二个建议(没有链接,只为当前页面设置li的样式),而且我想要学习如何做第三个建议。这是一个对我来说有点儿好吧现在。当我看到#时,我会自动思考tic-tac-toe。

Thank you for your help, Dorayme.
Well I followed the first suggestion so far, but I plan to implement the
second suggestion (no link, just styling the li for the current page), and I
want to learn how to do the third suggestion. It''s a little beyond me right
now. I automatically think "tic-tac-toe" when I see #.




骑自行车的吉他手 ;< Ch *** @TheBicyclingGuitarist.net写信息

news:47 ********************** @ read.cnntp .org ...

"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in message
news:47**********************@read.cnntp.org...

你好。我的所有页面顶部都有一个导航栏,带有css风格的

按钮,当悬停时会改变颜色。我对如何为页面所在的链接禁用

感到有点困惑,例如站点地图页面导航栏中的站点地图

链接,
的研究链接
Hello. I have a navigation bar at the top of all my pages with css-styled
buttons that change color when hovered over. I am a little confused on how
to disable that for the link that the page is on, for example, the sitemap
link in the navigation bar on the sitemap page, the studies link for the



哎呀。我刚刚注意到站点地图页面的导航栏比所有其他页面上的导航栏小一点。我认为

这是因为我为< pand< ain设置了网站标题

地图页面的样式,所以它们只有90%的常规尺寸(因为那个

页面上的所有链接)。如果不改变身体的90%

内容,最好的解决方法是什么?我不想指定一个班级名称,并将其放入每一页

< pand< aon page。

Oh heck. I just noticed that the navigation bar for the site map page is a
wee bit smaller than the navigation bars on all the other pages. I think
this is because I have set styles for <pand <ain the header of the site
map page so they are only 90% regular size (because of all the links on that
page). What''s the best fix for this without changing the 90% for the body
content? I don''t want to assign a class name and put that into every single
<pand <aon the page.


In文章< 47 ********************** @ read.cnntp.org>,

" The Bicycling Guitarist" < Ch *** @ TheBicyclingGuitarist.net>

写道:
In article <47**********************@read.cnntp.org>,
"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.net>
wrote:

" dorayme" < do ************ @ optusnet.com.auwrote in message

news:do **************** ****************** @ news-vip.optusnet.com.au ...
"dorayme" <do************@optusnet.com.auwrote in message
news:do**********************************@news-vip.optusnet.com.au...

in article< ; 47 ********************** @ read.cnntp.org>,

The Bicycling Guitarist < Ch *** @ TheBicyclingGuitarist.net>

写道:
In article <47**********************@read.cnntp.org>,
"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.net>
wrote:


第三,(但我没有正确研究你的网站,所以这可能不是整个方便的b $ b)你通常不需要保持

put类= QUOT; MENU2"如果您使用#menubar li a指定

样式。它更简洁。
Third, (but I have not studied your site properly so this may not
be convenient on the whole) you don''t generally need to keep
putting class="menu2" if you use #menubar li a to specify a
style. It is briefer.



感谢您的帮助,Dorayme。

我到目前为止遵循了第一个建议,但我计划实施

第二个建议(没有链接,只为当前页面设置了样式),而且我想要学习如何做第三个建议。这有点超出我的权利

现在。我自动地认为tic-tac-toe当我看见 #。


Thank you for your help, Dorayme.
Well I followed the first suggestion so far, but I plan to implement the
second suggestion (no link, just styling the li for the current page), and I
want to learn how to do the third suggestion. It''s a little beyond me right
now. I automatically think "tic-tac-toe" when I see #.



好​​的,大约第三个,这里有一个案例,节省了相当多的b $ b - 可能会让你看到它有多容易是:


假设你想浮动一个*很多*的div,你希望它们是一个特定大小的

,也许是其他特殊的东西。让我们

假设他们在一个包装div中。


< dv id =" wrapper"> ...很多div在.. 。< / div> ;.

每个内部div都是一个镗孔(以及增加带宽和杂乱)

class。更容易将它们全部定位在

一个过去:


#wrapper div {float:left; width:... etc ...;}


这个目标是#wrapper div的所有div子节点。在其他地方没有任何其他div。您还可以使用分类包装。 ID在这里

只是一个例子(强调它是独一无二的,因此

a相当不错的手柄来识别整个孩子的暴徒)。


从我所看到的你的css,我相信你确实理解这个

想法到一定程度(参见你自己的CSS!)。


-

dorayme

OK, about the third, here is a sort of case where the savings are
considerable - might get you to see how easy it is:

Suppose you want to float a *lot* of divs, you want them to be a
certain size as well and maybe other special things. Let us
suppose they are in a wrapper div.

<dv id="wrapper">...lots of divs within...</div>.

It is a bore (as well as adding to bandwidth and clutter) to
class every single inner div. It is easier to target them all in
one go by:

#wrapper div {float: left; width: ... etc ...;}

This targets all the div children of the #wrapper div. Not any
other divs elsewhere. You can also use classed wrappers. ID here
is just an example (to emphasise that it is unique and therefore
a rather nice handle to identify a whole mob of its children).

From what I did see of your css, I am sure you do understand this
idea to a degree (see your own css!).

--
dorayme


这篇关于菜单链接不改变颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆