- This topic is empty.
-
AuthorPosts
-
March 20, 2012 at 4:44 pm #99570
FearlessChicken
MemberI’m checking out your post now………back atchya in a sec…..
March 20, 2012 at 4:55 pm #99573FearlessChicken
MemberAWESOME YOU SOLVED IT!!!! :) Thank you so much! I really only needed to define the visited state. I had it there, but I never gave it a button background. Going with what you said, I made the visited state have the up background (the same as my a:link state). In other words, I don’t really need a visited state I just need the button to stay the same and not go white when it loses focus the first time.
As for changing focus to active, I’m not completely following you on that one. Let me explain. What I’m after is I want a given button to reflect the page you are on with either a different background color or graphic. That seems to me to be the focus. The active state on the other hand, seems to be right when you click on the button…..like if you wanted the button to press inward as you click to give a realtime effect that it’s getting pushed at the instance you click it. Once the click is done, the image change goes away. That won’t work for having the button reflect what page you are currently on right? So, that brings me back to the need to use the focus state. Perhaps I’m still not understanding.
Thanks!
March 20, 2012 at 5:37 pm #99575xpy
ParticipantYou need JavaScript to achieve what you want… CSS doesn’t do that… :active means the button is being clicked and :focus means it was the last thing clicked… What you need is to add a class via JavaScript to the clicked anchor or li, which you could also do with php…
March 20, 2012 at 6:04 pm #99578FearlessChicken
MemberThank you! I’ve done quite a bit of programming, but new to CSS. I understand what you are saying about the javascript and php. The javascript would run on the client and swap out the images I guess–I’ve seen rollovers done like that….in javascript where the code does the image swapping.
But, if :focus means it was the last link clicked, then as long as I set my background to the down state there, then why would that not meet my needs? It seems to be working and doing what I want. I guess I’m still not understanding something; please help…
March 20, 2012 at 6:15 pm #99581xpy
Participant@FearlessChicken see here for more detail on :focus
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.