- 骑自行车的吉他手Hello. I have a navigation bar at the top of all my pages with css-styledbuttons that change color when hovered over. I am a little confused on howto disable that for the link that the page is on, for example, the sitemaplink in the navigation bar on the sitemap page, the studies link for thenavigation bar on the studies page, etc.The css is at http://www.TheBicyclingGuitarist.net/css/style.cssThe sitemap is at http://www.TheBicyclingGuitarist.net/sitemap.htmAny tips will be greatly appreciated. Do I need to make a new class andsurround 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 messagenews: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-styledbuttons that change color when hovered over. I am a little confused onhow 首先,是的,你可以把你不想要的链接分类有 悬停效果; < a class =" current" href =" ...是一种常见的 练习。然后,您可以在css中设置.current的样式。First, yes, you can just class the link you do not want to havehovering effects; <a class="current" href="...is a commonpractice. 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 acursor hand will appear, in this case you might style just the liitself to fit in with the real links in style. It is common andinformational to have the text a little different, perhaps incolour or background (this is an extra way for users to knowwhich page they are on out of the choices in the navigation strip.Third, (but I have not studied your site properly so this may notbe convenient on the whole) you don''t generally need to keepputting class="menu2" if you use #menubar li a to specify astyle. 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 thesecond suggestion (no link, just styling the li for the current page), and Iwant to learn how to do the third suggestion. It''s a little beyond me rightnow. I automatically think "tic-tac-toe" when I see #. 骑自行车的吉他手 ;< Ch *** @TheBicyclingGuitarist.net写信息 news:47 ********************** @ read.cnntp .org ..."The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in messagenews:47**********************@read.cnntp.org... 你好。我的所有页面顶部都有一个导航栏,带有css风格的 按钮,当悬停时会改变颜色。我对如何为页面所在的链接禁用 感到有点困惑,例如站点地图页面导航栏中的站点地图 链接, 的研究链接Hello. I have a navigation bar at the top of all my pages with css-styledbuttons that change color when hovered over. I am a little confused on howto disable that for the link that the page is on, for example, the sitemaplink 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 awee bit smaller than the navigation bars on all the other pages. I thinkthis is because I have set styles for <pand <ain the header of the sitemap page so they are only 90% regular size (because of all the links on thatpage). What''s the best fix for this without changing the 90% for the bodycontent? 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 messagenews: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 thesecond suggestion (no link, just styling the li for the current page), and Iwant to learn how to do the third suggestion. It''s a little beyond me rightnow. 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!)。 - doraymeOK, about the third, here is a sort of case where the savings areconsiderable - might get you to see how easy it is:Suppose you want to float a *lot* of divs, you want them to be acertain size as well and maybe other special things. Let ussuppose 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) toclass every single inner div. It is easier to target them all inone go by:#wrapper div {float: left; width: ... etc ...;}This targets all the div children of the #wrapper div. Not anyother divs elsewhere. You can also use classed wrappers. ID hereis just an example (to emphasise that it is unique and thereforea 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 thisidea to a degree (see your own css!).--dorayme 这篇关于菜单链接不改变颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-30 09:46