Re: Strange css problem (bug?)



M O J O wrote:
>
> Hi,
>
> I'm developing a asp.net application and ran into a strange css problem.
>
> I want all my links to have a dashed underline and when they are
> hovered, it must change to a solid line. Sounds simple, but it's not
> working.
>
> I've cooked down my output code to show you what I mean. If you run the
> code below, there's no line under the link, but if you either remove the
> <!DOCTYPE...> line or the body-part of the css decleration, everything
> works fine.
>
> Here's my code (watch for wrappings):
>
> ----------------------------------------------------------------------
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <title>Strange</title>
> </head>
> <body>
> <style>
> <!--
> body
> {
> font-family: verdana, arial, helvetica, sans-serif;
> }
>
> a:link, a:visited
> {
> font-family: verdana, arial, helvetica, sans-serif;
> color: #d32525;
> border-bottom: 1px dashed #d32525;
> text-decoration: none;
> }
>
> a:hover
> {
> font-family: verdana, arial, helvetica, sans-serif;
> color: #d32525;
> border-bottom: 1px solid #d32525;
> text-decoration: none;
> }
>
> -->
> </style>
>
> <a href="http://www.microsoft.com/";>This is just a link</a>
>
> </body>
> </html>
>
> ----------------------------------------------------------------------
>
> Any idea???????
>
> I also found out, if I put a <p>&nbsp;</p> below the <a href...> in the
> code above, everything works fine.

I copied your sample into a new HTML file and tried it with Mozilla
Suite 1.7.11. It works exactly as you describe your intent: There
was a dashed underline for the link until I hovered my cursor over
it, when it changed to a solid underline.

By the way, you have defined font-family for body. You don't have
to repeat the definition for the anchors unless you are using a
different set of fonts for them.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
.