View Full Version : Using the a:focus for nav links

10-04-2006, 03:46 AM

I was watching your VTMs on your site that you recommended to kona72.
I think they are great and they are really helping me to finally understand how to layout a 1, 2, or 3 colum site using CSS. In the first tutorial "CSS Single" you talk about using the focus for the top nav link. I was wondering, what is a practial purpose for using that? I have never seen it used before, or I have and didn't realize it. Thanks!

Creative Insanity
10-04-2006, 06:51 AM
a:focus will keep the hoverstate active if a button is pressed.
If you make the hover and focus the same in a nested selector once you click a link it will stay in that state until the mouse is clicked again.

10-04-2006, 02:05 PM
I did understand that from the tutorial - you did a good job explaining that. Sorry if my didn't explain myself better. What meant to ask is what it the purpose if doing that. Sometimes sites have the current page your on highlighted, but with the a:focus once you click it goes away. I am starting to confuse myself so I hope I didn't confuse you. :?

10-04-2006, 03:59 PM
Try this: enter a new page and hit your TAB key, you'll see that every time you hit the TAB key, another link gets the FOCUS state. With a:focus you can apply a seperate style when a link is in this state.

10-04-2006, 04:13 PM
OK... I kind of get it. Is this used a lot?

10-04-2006, 05:49 PM
tabbing you mean? For people that know how, I guess they're used exensively on forms and other things that requires focus.

Creative Insanity
10-04-2006, 07:25 PM
Ta dom saved me a job. I am a tab junkie so I guess focus is something I will always use. I prefer a KBS rather than taking my hands off the kb. So if there is a KBS then I will surely use it.. you should see me go KBS wild in maya LOL

10-05-2006, 07:36 PM
I love using KBS - In Photoshop, Illustrator, and Final Cut I use them constantly. i had no idea that focus was apart of that. Thanks for clearing that up for me! :D

Looking forward to the rest of your tutorials.