tags:

views:

62

answers:

4

hi,

I don't understand why the link ("55") in the top-right corner of this document is always underlined:

http://dl.dropbox.com/u/72686/print.html

I've specified text-decoration:none but it is still underlined.

Update: I have an issue, I cannot add it to the link because it is self-generated html. Also, I don't have access to the tag of the document. Can I add a tag in the ? Or just before the link ?

thanks

+3  A: 

You've put the styling on the span, you need to put your styling on the link.

Change your css from

span
{
    text-decoration:none;
}

to

span a
{
    text-decoration:none;
}

Or if you insist on doing it inline, put the style= on the <a> tag

SLC
You're on the right track, but the style is inline on the span - not in the CSS document. Either the style needs moving to a CSS file using the selector you specified or the inline style on the span needs moving to the child link.
Andy E
hi, I have an issue, I cannot add it to the <a> link because it is self-generated html. Also, I don't have access to the <head> tag of the document. Can I add a <style> tag in the <body>? Or just before the link ? thanks
Patrick
Yes, I would recommend using a CSS file though, as inline styles are usually bad practice. You should read up on how to use them (it's very easy) and add some CSS as I wrote above with span a
SLC
A: 

Try to change the css style with javascript. For example:

   <script language="javascript">
   var objects = document.getElementsByTagName("a");

   for(var no=0;no<objects.length;no++)
   {
      objects[no].style.textDecoration = "none";
      objects[no].style.color = "#000000";
   }
  </script>
Vasil Dakov
hi, I have an issue, I cannot add it to the <a> link because it is self-generated html. Also, I don't have access to the <head> tag of the document. Can I add a <style> tag in the <body>? Or just before the link ? thanks
Patrick
If you want the code to validate properly you can't have a style block in your body only in the head. But most browsers will apply it correctly.
Denis Hoctor
Yes, I agree with Denis Hoctor. Since you can't change the style with css, try to do it with javascript.
Vasil Dakov
A: 

You can add to body, it will work, but I'm not sure it's according to specs.
In it write
span a { text-decoration: none }

Dani
A: 

Assuming you are ok to remove all underlines from all links, add this to <head> section of your HTML document:

<style type="text/css">
a, a:link, a:visited, a:hover { text-decoration:none; }
</style>

BTW, compare to other solutions only mine is cross-browser compatible, a { ... } doesn't work on IE6.

rochal