[RESOLVED] How to remove red border around the image when using "HyperLink" control

hi there,

I have few images on my aspx website and was trying to do a simple link to another page from the image.  Noticed that the image control does not let me specify the url, and when i was playing wtih <a href... in source code i run into some issues.

Then i noticed HyperLink control and i used that one.  In a property window i see "ImageURL", and "NavigateURL", so i guess that eliminated the need for a "Image" control. 

The only problem that i run into with the "hyperlink" control is that once the link is created, the image has a "nasty" red border which i need to remove but i am not sure how to.  I set border style to None and it did not work.  Then i tried to set border width to 0 and still i have a red border around my image. 

How do i remove that annoying red border and is there a better way to do image link with aspx?


i'd use css

try adding this to your stylesheet

    a img {border-style:none;}



I don't use stylesheets, but when i use border-style:none in the property window of the control i still have the red border.  



you dont want to apply the style to the Hyperlink control as you be applying the style to the anchor tag rather than to the image that inside the anchor tag.

I'd encourage you to consider using stylesheets. 

you can also add a little inline style on your page just to see how it works.

<style type="text/css">

    a img {border-style:none;}




Thank you for your advice and suggestion, it solved my problem.


thoughts on "[RESOLVED] How to remove red border around the image when using "HyperLink" control"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>