SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2003
    Location
    uk
    Posts
    447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get rid of the border in the hyperlink?

    I have an image with a link but it has a border around it showing it is a link. In the style sheet. I already defined the text decoration as none for hyperlink as shown below:

    a:link {text-decoration: none;}

    ----html
    <div class="ham1">
    <P class = "para2">
    <a href="hello.html"><img src = "imag1.jpg"></a></p>
    </div>

    it only applies to text which does nt show any decoration but for the image it shows the link in the form of a border.

    any idea how to resolve this issue?

    many thanks

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remove the border from the image.

    I personally style all images like this specifically to avoid issues in IE and other browsers:

    Code CSS:
    img {
    	border: 0;				/* this squashes a Firefox bug and removes the border from image links */
    	display: block;			/* this squashes an IE bug */
    }

    There's no need to define an ID or class, just slap it in near the top of your stylesheet and forget about it.

  3. #3
    SitePoint Evangelist
    Join Date
    Dec 2003
    Location
    uk
    Posts
    447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It has worked
    Thanks mate.


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
  •