a:hover does not work without href attribute in <a> ?



Is there a reason why this does NOT work in IE6.0 ?

<html>
<head>
<style type="text/css">
a
{
text-decoration: none;
}
a:hover
{
text-decoration: underline;
}
</style>
</head>
<body>
<a>Some text</a>
</body>
</html>

It only works when I add the href attribute:

<a href="">Some text</a>

I have already read that the <a> HTML tag is the only tag in IE that
supports the hover. I have created a treeview and all my <a> tags look like
this:

<div>
<a onClick="toggle(this)">Node 1</a>
</div>

In my toggle function I will set the style of the <div> to either
display:none or display:visible, that works. I need to hover of the <a> tag
so that whenever I move my mouse over Node 1 the background color changes.
How can I achieve this?

I am trying to create something similar like the treeview you can find at
http://msdn.microsoft.com/library/default.asp or does anybody know how the
deeptree.css looks like?

TIA

Gabriel Lozano-Morán


.



Relevant Pages

  • Re: node.innerHTML = ... not working in IE
    ... > any indication of how the javascript is interacting with the HTML. ... >> place the suggest_box div node right next to the textbox so ... > opening P tag encountered within a P element will imply that P element's ...
    (comp.lang.javascript)
  • Re: node.innerHTML = ... not working in IE
    ... > place the suggest_box div node right next to the textbox so ... So why not set the inner HTML before you insert the node (or use W3C DOM ... > thrown on line 10 in CODE SAMPLE 1): ... P element also has an optional closing tag, which may be implied by the ...
    (comp.lang.javascript)
  • Re: JSTL forEach
    ... <html xmlns="http://www.w3.org/1999/xhtml"</a>;> ... the tag is still in the generated output. ...
    (comp.lang.java.programmer)
  • RE: looking for a popup control like in MSCRM...
    ... to dynamically show and hide a HTML tag on the page. ... I have an example where I use a <div> tag and populate its data using ... when the user clicks a selection. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Height property of TreeView control in Whidbey
    ... I'm using Treeview control that comes with VS 2005. ... control inside a tag. ... Now this <div> is made visible when a client side ...
    (microsoft.public.dotnet.framework.aspnet)

Loading