CSS- dashed underline- How To?

  • Thread starter Thread starter jd
  • Start date Start date
Be aware that this will make your link jump when hovered. If you want to
avoid that, you can do this -

a { text-decoration:none; border-bottom: 1px solid
#whatever-your-page-color-is; }
 
I did it using a class "underdash" and a hyperlink in this
example.
The border is defined size and colorwise for the non hover
state so the <a> text does not shift to accomodate the
border

<html><head>
<style type="text/css">
.underdash {border-bottom: 1px #fff solid;
text-decoration:none;}
.underdash a:hover {border-bottom: 1px #000 dashed}
</style>
</head>
<body>
<p class="underdash">
<a>Text Sample</a>
</p>
</body></html>




: Does anyone know how to write a CSS line that will display
a broken
: underline on hover?
:
:
 
Good point, thanks.

Cheers,
Jon

Murray said:
Be aware that this will make your link jump when hovered. If you want to
avoid that, you can do this -

a { text-decoration:none; border-bottom: 1px solid
#whatever-your-page-color-is; }
 
borders, heck i have even done this once for a client who wanted that.
That's what I get for making it more difficult and forgetting
 
Judging from the times that the other solutions were
presented, I think we were all thinking the same thing at
the same time...

: That'd do it.
:
: --
: Murray
: --------------
: MVP FrontPage
:
:
: : >I did it using a class "underdash" and a hyperlink in
this
: > example.
: > The border is defined size and colorwise for the non
hover
: > state so the <a> text does not shift to accomodate the
: > border
: >
: > <html><head>
: > <style type="text/css">
: > .underdash {border-bottom: 1px #fff solid;
: > text-decoration:none;}
: > .underdash a:hover {border-bottom: 1px #000 dashed}
: > </style>
: > </head>
: > <body>
: > <p class="underdash">
: > <a>Text Sample</a>
: > </p>
: > </body></html>
: >
: >
: >
: >
: > : > : Does anyone know how to write a CSS line that will
display
: > a broken
: > : underline on hover?
: > :
: > :
: >
: >
:
:
 
Back
Top