473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

menu link to not change color

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
Jan 14 '08 #1
10 3887

"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>
wrote:
>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
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.
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.
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 #.
Jan 14 '08 #2

"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in message
news:47**********************@read.cnntp.org...
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
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.
Jan 14 '08 #3
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...
In article <47**********************@read.cnntp.org>,
"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.net>
wrote:
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.

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 #.
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
Jan 14 '08 #4

"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in message
news:47**********************@read.cnntp.org...
>
"The Bicycling Guitarist" <Ch***@TheBicyclingGuitarist.netwrote in
message news:47**********************@read.cnntp.org...
>Hello. I have a navigation bar at the top of all my

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?
For now, I removed the 90% from the css in the header. I could add it back
for the div containing the sitemap content, or not. I thought that with so
many links, that having slightly smaller text would be more useful.
Jan 14 '08 #5
On 14 Jan, 06:35, dorayme <doraymeRidT...@optusnet.com.auwrote:
There are some server side solutions so the page itself "knows"
which page it is and "turns off" links to itself. In PHP.
You can do that statically too.

Put a "pagename" class onto the body for each page.

Use slightly more complex CSS selectors (including a hard-coded list
of pagenames) to recognise each of these.
The cost of this is needing to hard-code that list into the CSS, but
it works, and it works with static code.
Jan 14 '08 #6
In article
<c2**********************************@k2g2000hse.g ooglegroups.com
>,
Andy Dingley <di*****@codesmiths.comwrote:
On 14 Jan, 06:35, dorayme <doraymeRidT...@optusnet.com.auwrote:
There are some server side solutions so the page itself "knows"
which page it is and "turns off" links to itself. In PHP.

You can do that statically too.

Put a "pagename" class onto the body for each page.

Use slightly more complex CSS selectors (including a hard-coded list
of pagenames) to recognise each of these.
The cost of this is needing to hard-code that list into the CSS, but
it works, and it works with static code.
Actually, thanks for the reminder on this. I speak, of course, on
behalf of the archives. <g>

--
dorayme
Jan 14 '08 #7

"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>
wrote:
>"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>
wrote:
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.
>now. I automatically think "tic-tac-toe" when I see #.

OK, about the third, here is a sort of case where the savings are
considerable - might get you to see how easy it is:
<snip>
<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!).
I understand it to a degree, but based on the online tutorials I've found
for css I'd rate myself at the low intermediate level, above beginner but
far below advanced. This newsgroup and the c.i.w.a.h. newsgroup have helped
me a lot over the years. What you have suggested with this tip is the next
great project for me to improve the code of my web site. It may take a while
yet.
Jan 15 '08 #8
Art
On 1/14/08 7:16 AM, Andy Dingley wrote:
On 14 Jan, 06:35, dorayme <doraymeRidT...@optusnet.com.auwrote:
>There are some server side solutions so the page itself "knows"
which page it is and "turns off" links to itself. In PHP.

You can do that statically too.

Put a "pagename" class onto the body for each page.

Use slightly more complex CSS selectors (including a hard-coded list
of pagenames) to recognise each of these.
The cost of this is needing to hard-code that list into the CSS, but
it works, and it works with static code.
Andy,
Do you have a code snippet or live example of this static method that
you could share ?

TIA.

--
Art
Jan 15 '08 #9
On 16 Jan, 01:51, dorayme <doraymeRidT...@optusnet.com.auwrote:
Hey, Andy! I notice the archive references are so easy to find
that you find it quicker to bang up examples on a keyboard.
I don't. I pasted that from an article in my own local archives - the
subject line was "Navigation", if you want to look for it.
Jan 16 '08 #10
Art
On 1/15/08 7:50 PM, Andy Dingley wrote:
On Tue, 15 Jan 2008 23:13:54 GMT, Art <me@nowhere.comwrote:
>>Do you have a code snippet or live example of this static method that
you could share ?

Of course - I keep it carefully filed in Google's archive of this
newsgroup. If you search, you might even find it, there are several
copies.

Otherwise try this for starters:
[...]
Thanks, Andy. A very innovative use of css.

--
Art
Jan 16 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
14
by: Don G | last post by:
Within the menu for my site, I have inserted 'class="current"' within the link for the current page. So the link looks somthing link: <li><a href="index.php" class="current">Home</a></li> The...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
1
by: Richard | last post by:
http://dynamicdrive.com/dynamicindex1/switchmenu.htm I want to add a second level menu item to the existing design. Currently only one level is possible. Item 1 ......link ......link item 2...
4
by: paula | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
3
roula
by: roula | last post by:
Hi, I'm modifying a template (flash menu with html pages), when you click on the flash menu (about us for example) the corresponding html page is displayed, and the "about us" flash menu is...
5
by: mukeshrasm | last post by:
hello friends I am new to javascript and I have a problem. I am giving the code <!-- Paste this code into the CSS section of your HTML document --> <html> <head> <style type="text/css">...
7
by: milestogofromhere | last post by:
It is late so this is probably something really obvious but I am not seeing it. Can someone please help? Here is the page in question: html - http://www.itsyourplate.com/index2.php css -...
4
by: N00b13 | last post by:
I have a great JS menu but I have to update every page each time I want to change a link. Is there a way to store my links in a file and call it so i only change that file? (what I have tried so far...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.