SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help with Span tag

    Hello,
    Im trying to use a span tag to put my hyperlink with an underline so that my image right next to it doesn't have the underline. Although it is not working in Firefox and it puts the underline underneath both the text and the image. I have tested it in Internet Explorer and it works perfectly and only puts the underline underneath the text and not the image but Firefox doesn't seem to render it right. Here is the code that I am using.
    Code:
    <a class="one"href="login.php"><img src="../assets/key_go.png" border="0" text-decoration="none"/><span style="text-decoration: underline;">Login</span></a>
    Any answers would be greatly appreciated!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,165
    Mentioned
    453 Post(s)
    Tagged
    8 Thread(s)
    It looks like you haven't removed the <a> element's default underline:

    Code:
    a {text-decoration:none;}
    See if that helps.

  3. #3
    SitePoint Enthusiast jjdrp's Avatar
    Join Date
    Jul 2003
    Location
    VA
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The <a> tag is responsible for underlining the link as the other poster stated. You were applying text-decotaction:none to the image instead of the <a> tag.

    The suggestion above is correct and should fix your problem.

  4. #4
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanx a bunch guys! God I knew it was something simple that I missed. But yea it works perfectly in Firefox now. And again thanx a bunch guys!

  5. #5
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    some times it happened as a matter of fact i could not under stand the problem at first sight

  6. #6
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea i kno i was like.. "what the heck is going on" lol


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •