I have an anchor that turns itself into a link when previewed.
Code for the anchor:
Kinetica
If you view the source of the previewed page it is the same as above. On the previewed page however, the word Kinetica is styled as if it is a link and if you hover/click it is pointing to:
http://cms.library.uwa.edu.au/staffonly/1
Anyone seen this before?
Thanks,
Sarah
Avi_Miller
(Avi Miller)
November 16, 2005, 8:38am
2
That makes sense, because the <A> tags are wrapped around the text. If you don't want the styling, close the <A> tag immediately, like so:
Kinetica
Alternatively, you could remove the styling for all <a> tags in your stylesheet:
a {
text-decoration: none;
color: inherit;
}
and apply whatever styles you like for <a> tags with an href attribute:
a[href] {
text-decoration: underline;
color: #00C;
}
Of course, this doesn’t work with any version of Internet Explorer… but it’s a neat CSS trick all the same.
More info: Attribute selectors [w3.org]