SitePoint Sponsor |
|
User Tag List
Results 1 to 14 of 14
Thread: CSS and links help needed!
-
May 9, 2002, 08:09 #1
- Join Date
- May 2002
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
CSS and links help needed!
CSS and links???
i have set my styles for links to be green when in normal, active and visited states and only to change when hovered. it works fine, but when i click on a link and then go back to the page with that link, the rollover action does not work unless i click my mouse on the page or refresh. how do i get the rollover state to work at all times even after the link is clicked and revisited?
the example is here;
http://www.keenerassociates.com/DRAFT/home.html
-
May 9, 2002, 08:20 #2
- Join Date
- Dec 2000
- Location
- The Sea of Tranquility
- Posts
- 696
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I've had a quick look at the css, and I can't see any problem with the code. Sorry
-
May 9, 2002, 08:24 #3
- Join Date
- Jul 2001
- Location
- The Netherlands
- Posts
- 2,617
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Could you post the portion of your CSS code where you defined the styles for your links?
-
May 9, 2002, 08:34 #4
- Join Date
- May 2002
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
sure thing.....
here's the code taken from my stylesheet:
.bodylink { font-family: Verdana, Arial, Helvetica, sans-serif; color: #006666; font-weight: bold; text-decoration: none; font-size: x-small}
a.bodylink:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
a.bodylink:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
a.bodylink:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #99CCCC; text-decoration: underline }
a.bodylink:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #99CCCC; text-decoration: none }
-
May 9, 2002, 08:37 #5
- Join Date
- May 2002
- Location
- Canada!
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
try moving all of the a.bodylink:hover {...} portion below the a.bodylink:active {...} portion.
for some reason, css wont read the link stuff after hover haas been defined. or at least not in my travels
thanks,
chillin
-
May 9, 2002, 08:38 #6
- Join Date
- May 2002
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
OOPS!! WRONG ONE!!
i'd actually made changes since i posted that. this is actually the correct one that corresponds to the problem and the url I posted.
.bodylink { font-family: Verdana, Arial, Helvetica, sans-serif; color: #006666; font-weight: bold; text-decoration: none; font-size: x-small}
a.bodylink:link { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
a.bodylink:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
a.bodylink:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #99CCCC; text-decoration: underline }
a.bodylink:active { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006666; text-decoration: none }
-
May 9, 2002, 08:42 #7
- Join Date
- May 2002
- Location
- Canada!
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
same thing still applies.
-
May 9, 2002, 08:44 #8
- Join Date
- May 2002
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
aaah haaaa......bingo!
how did you ever figure that one out? trial and error, i assume. would have never thought that would be it!
thanks you are a life saver!!
(p.s. do you know anything about dreamweaver and the show/hide layers option??)
-
May 9, 2002, 10:16 #9
- Join Date
- Jul 2001
- Location
- The Netherlands
- Posts
- 2,617
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There is a little rule of fist you could use.
At first a link is a link, it is not active or whatever. When clicked, the link becomes active immediately, and after that it is visited.
The hover attribute is a little extra, which should overrule all classes, so therefore it is mentioned last.
I always used that when I started out with CSS, now it has become habit to place them in the right order.
-
May 9, 2002, 10:31 #10
- Join Date
- May 2002
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
funny, someone on another forum told me to keep them in this order
link
visited
hover
active
but that's how they were originally and it didnt work until i switched hover and active.
it's good to know that these things make such a difference!
-
May 10, 2002, 00:51 #11
- Join Date
- Mar 2002
- Posts
- 54
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Please try the following syntax:
bodylink a:link
bodylink a:visited
bodylink a:hover
bodylink a:active
L V H A is the correct order.
I was lecturing on this very topic the other day.
Please let me know if it works!!!!
Nancy
-
May 10, 2002, 01:21 #12
- Join Date
- May 2002
- Posts
- 17
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
you say tomato they say tomato some say tomorrow!
LVHA is what i originally had but it didnt work.
someone suggested LVAH which was the only syntax that did actually work.
i never would have thought this would make a difference!
-
May 10, 2002, 12:58 #13
- Join Date
- May 2002
- Location
- Canada!
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
glad to hear it works!
i found out by spending a good hour or so on it...
what a pain it was.
good luck.
-
May 13, 2002, 01:59 #14
- Join Date
- Jan 2002
- Location
- Swindon UK
- Posts
- 620
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well, that's a funny little quirk indeed. I have learned something new today. Seems that I've not had this error occur in my pages, but it could easily have happened - if it does, I'll know why now!
Build Your Own Web Site the Right Way!
A beginners' HTML/CSS book with web standards at its heart
The Ultimate HTML Reference
A complete reference, in glorious hardback
Bookmarks