Jump to content

javascript in css?


yoshida
 Share

Recommended Posts

Hey folks.So I'm working on a css (dúh) and one thing I achieved thanks to this forum was defining link behavior in CSS. This particular part is covered by following code:

A:link {text-decoration: none;color:#222299;}A:visited {text-decoration: none;color:#222299;}A:active {text-decoration: none;color:#222299;}A:hover {text-decoration: underline;color:#cc7700;}

This means all links are blue at all times with no underline, and turn orange on hover and gain an underline. When I define a link all I have to do is <a href=somepage.html target=someframe> and everything works fine.I still get a box around a link when I click on it. It's tackled by adding onFocus="if(this.blur)this.blur()" to a link so it looks like this:

<a href=somepage.html target=someframe onFocus="if(this.blur)this.blur()">here's a link, click it.</a>

Is there a way to add javascript to a css, so all links have no box around them once clicked? I can probably define this in the head of each page (if I only knew the first two or three things about JavaScript but I don't) but I'd very much like to implement it in my separate .css file.Help appreciated.EDIT: never mind. I googled for a bit, and discovered it's an ugly thing to make links lose focus on focus (tabbing and active link color is also disabled). It's a side effect of an accessibility treshold and I will no longer use it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...