HighDots Forums  

Specify color of current selected link in nav bar

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Specify color of current selected link in nav bar in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
adenucci36
 
Posts: n/a

Default Specify color of current selected link in nav bar - 07-12-2004 , 11:09 AM






Hi,
I am working on a navigation bar for our website. I am stuck on the last
piece. Currently there are two headings, each with links underneath. When you
hover over a link, it changes from white to tan, along with the bullet next to
it. When a link is clicked, I would like it to remain tan while the user is on
that page. When they click a different link to go somewhere else, that link
should change to tan, and the previously clicked link should go back to white.
I can't get the link to stay tan while it is clicked. Right now the page
references a stylesheet for all the color changes. a:hover works fine for the
hover part. What am I missing as far as changing the link text color while the
corresponding page is open?


Reply With Quote
  #2  
Old   
~Flash~
 
Posts: n/a

Default Re: Specify color of current selected link in nav bar - 07-12-2004 , 11:46 AM






On the page that's open change the color of the link on the nav bar that your
at to the link (highlight it and change it in properties[have the link return
to it's original color after clicking),

Flash



Reply With Quote
  #3  
Old   
adenucci36
 
Posts: n/a

Default Re: Specify color of current selected link in nav bar - 07-12-2004 , 12:15 PM



I don't think I can do that in this instance (or I may just be misunderstanding
you). I am trying to use a style.css page for this code, so any changes I make
will affect the whole site. I tried using the a:active property, but that
doesn't seem to do anything. I can get the color to change when I hover over
the link, but I can't get it to change when a specific page is selected. Say
someone clicks on the test.asp link. I want this link to appear tan while the
test.asp page is open, but if they move to another page, the link should go
back to white, and the link text of the page they have moved to (say they
selected links.asp) should now be tan until they leave that page. Is this
possible without having to clear out the browser memory?


Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Specify color of current selected link in nav bar - 07-12-2004 , 02:15 PM



Pseudo-classes and container styles are what you need - here are some
tutorials.
http://www.mako4css.com
http://www.thepattysite.com/linkstyles1.cfm
http://www.projectseven.com/tutorials/pseudoclasses/index.htm

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"adenucci36" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I don't think I can do that in this instance (or I may just be
misunderstanding
you). I am trying to use a style.css page for this code, so any changes I
make
will affect the whole site. I tried using the a:active property, but that
doesn't seem to do anything. I can get the color to change when I hover
over
the link, but I can't get it to change when a specific page is selected.
Say
someone clicks on the test.asp link. I want this link to appear tan while
the
test.asp page is open, but if they move to another page, the link should
go
back to white, and the link text of the page they have moved to (say they
selected links.asp) should now be tan until they leave that page. Is this
possible without having to clear out the browser memory?




Reply With Quote
  #5  
Old   
Thwack318
 
Posts: n/a

Default Re: Specify color of current selected link in nav bar - 07-12-2004 , 04:46 PM



If you apply a style to an individual link on a page, it will override your
style sheet. So on page A give the link for page A a style="color:tan" in
addition to the class="whatever". Or to save work if you ever want to change
the color, define a new class that contains the color:tan and add it, such as
class="whatever current".

If you really want to get fancy, you can use some kind of scripting to detect
the current page title and write the additional class or style for each link
depending if its name matches the page title. (That way every page has the
same code and they only become different when served.)

Originally posted by: adenucci36
I don't think I can do that in this instance (or I may just be
misunderstanding you). I am trying to use a style.css page for this code, so
any changes I make will affect the whole site. I tried using the a:active
property, but that doesn't seem to do anything. I can get the color to change
when I hover over the link, but I can't get it to change when a specific page
is selected. Say someone clicks on the test.asp link. I want this link to
appear tan while the test.asp page is open, but if they move to another page,
the link should go back to white, and the link text of the page they have moved
to (say they selected links.asp) should now be tan until they leave that page.
Is this possible without having to clear out the browser memory?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.