Can i ask a question of CSS?

M

mike

i want to use onFocus tag in order to remove dot line
but it is very disgusting everytime i wrote this <a> tag
so my question is
can i use onfocus tag in CSS??
it will be helpful to me...
thanks
 
K

Karl Seguin

well, CSS supports a pseudclass called hover, so you can do:

a:hover
{
text-decoration: none;
}

not sure if text-decoration:none is the style you want to apply, but from
your description it sounds like :hover is what you want.

Karl
 
M

mike

it's not what i want
it remove underline of text..etc but it's not..
when i select <a> tag there is a rectangle dot line.
to remove this only use onfocus='this.blur()'
check it out~~
 
K

Karl Seguin

Oh, that.

It's an accessibility thing. I wouldn't remove it, but if you want, try:

a
{
outline:0px;
-moz-outline:0px;
}

outline:0px will remove it in Opera and Firefox 1.1 (when it comes out)
-moz-outline will remove it in current versions of Firefox
 
M

mike

it doesn't work in MS IE ~~ lol


Karl Seguin said:
Oh, that.

It's an accessibility thing. I wouldn't remove it, but if you want, try:

a
{
outline:0px;
-moz-outline:0px;
}

outline:0px will remove it in Opera and Firefox 1.1 (when it comes out)
-moz-outline will remove it in current versions of Firefox
 
K

Karl Seguin

There might be a more elegant way, but if you put:

<script language="javascript">
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; ++i)
{
anchors.onfocus = function()
{
this.blur();
}
}
</script>

at the bottom of the page, it'll grab all A tags, and automatically add the
code to them :)

karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top