WordPress.org

Support

Support » How-To and Troubleshooting » Remove border from image links

Remove border from image links

Viewing 5 replies - 1 through 5 (of 5 total)
  • I would add a little bit of CSS to the end of your style.css file. It would go something like this:

    a img { border:0; }

    This tells the browser that any image nested within an anchor will have a border of 0px.

    I hope this helps 🙂

    style=”text-decoration:none; cursor:pointer;”
    Jus add the style to you anchor after href=”your link” that will take care of the problem

    @usubba, I wouldn’t recommend that method, I’ll explain why:

    The original post asked for “all images” not just one or a few. When you’re dealing with a site-wide specification like that, it’s best to add your code to the theme itself either in the style.css file or one of the template files.

    The approach style="text-decoration:none; cursor:pointer; is good for one or two elements that require that one style.

    Well, let me add some info.
    The problem is thal this only happens when using Iinternet Explorer, and not with any other browsers!
    I’v had a similar problem tha was by changing some code in the top of the style.css file:

    <!--[if IE ]>
    	<style type="text/css">
    		#ddnav li ul{
    			position: absolute;
    			left: -999em;
    			margin-top: 0px;
    		}
    		#ddnav a{
    			width:auto;
    		}
    		a img {
    			border:0;
    		}
    	</style>
    <![endif]-->

    The idea was to change this property at the template level, as Jorge points out.
    I tried as above but no results.

    Personally, I would specify which version of IE in your ‘if’ tag, like this:

    <!--[if IE 6]><![endif]-->
    <!--[if IE 7]><![endif]-->
    <!--[if IE 8]><![endif]-->
    <!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!--<![endif]-->

    This particular snippet allows you to specify the versions of IE that we find annoying. The last line is anything but versions 6,7, or 8 so the latest versions of Chrome, Firefox and IE9 (and up) will pick that up.

    Also, any CSS you add, let’s say, to the header.php of your theme, make sure it is added after the ‘style.css’ file.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove border from image links’ is closed to new replies.