I have a hyperlink Image and I can't seem to get it to stop displaying an outline around the hyperlink. Not sure why... Heres my code...and setting the borderstyle or borderwidth is doing nothing.
No button_details.gif has no blue border around the image.
Its putting a blue image around the entire gif.
I think it may have something to do with the "whole" style sheet. Like maybe hyperlink colors has been defined for the whole page already or something like that....but not sure.
**************************************************
Don't forget to mark solution providing post as "Answered".
It helps others to find correct solutions!
codeaholic
Participant
1367 Points
707 Posts
How to stop a border around a Hyperlink Image
Oct 26, 2010 07:20 PM|LINK
I have a hyperlink Image and I can't seem to get it to stop displaying an outline around the hyperlink. Not sure why... Heres my code...and setting the borderstyle or borderwidth is doing nothing.
<asp:HyperLink ID="HyLinkDetails" runat="server" ImageUrl="~/App_Themes/Default/button_details.gif" NavigateUrl='<%# Eval("OrderURL") %>' BorderStyle="None" BorderWidth="0px">Details</asp:HyperLink>sansan
All-Star
53942 Points
8147 Posts
Re: How to stop a border around a Hyperlink Image
Oct 26, 2010 08:08 PM|LINK
I don't see any difference with border for hyperlink. It seems like button details has something to do with the border.
codeaholic
Participant
1367 Points
707 Posts
Re: How to stop a border around a Hyperlink Image
Oct 26, 2010 08:12 PM|LINK
No button_details.gif has no blue border around the image.
Its putting a blue image around the entire gif.
I think it may have something to do with the "whole" style sheet. Like maybe hyperlink colors has been defined for the whole page already or something like that....but not sure.
This ??
a:link, a:visited
{
color: #034af3;
text-align: left;
}
codeaholic
Participant
1367 Points
707 Posts
Re: How to stop a border around a Hyperlink Image
Oct 26, 2010 09:50 PM|LINK
Here is a screenshot of the blue line around the hyperlink based button
And here is the image by itself
sansan
All-Star
53942 Points
8147 Posts
Re: How to stop a border around a Hyperlink Image
Oct 26, 2010 10:04 PM|LINK
I think somewhere generic border is defined for hyperlinks. Search for border in your stylesheet.
Stylesheet might be having a css like this
codeaholic
Participant
1367 Points
707 Posts
Re: How to stop a border around a Hyperlink Image
Oct 26, 2010 10:30 PM|LINK
Its very aggrevating because nothing I'm doing is making a difference.
I coraled all of the a links together and commented them all out from the style sheet= No change.
I don't understand why setting the properties directly in the object won't override any thing else in the page.
I don't see the blue line in the design GUI of Visual Develper ONLY in IE....so that also is beyond strange.
I even added this...no difference
a:link, a:visited { color: #034af3; text-align: left; border-style: none; outline-style: none; }prateektiwar...
Member
342 Points
55 Posts
Re: How to stop a border around a Hyperlink Image
Oct 27, 2010 02:47 PM|LINK
Please try this n let me know
a:active { outline: none; } a:focus { -moz-outline-style: none; }Prateek Tiwari
**************************************************
Don't forget to mark solution providing post as "Answered".
It helps others to find correct solutions!
codeaholic
Participant
1367 Points
707 Posts
Re: How to stop a border around a Hyperlink Image
Oct 27, 2010 05:29 PM|LINK
Thanks...I tried both of those things in the style sheet and it didn't have any effect
codeaholic
Participant
1367 Points
707 Posts
Re: How to stop a border around a Hyperlink Image
Oct 27, 2010 06:35 PM|LINK
Ok, this was a hard problem. I found the solution here: http://www.codeproject.com/Tips/115565/Remove-blue-border-when-image-is-inside-the-hyperl.aspx
I had to add this to the style sheet
a img { border: none; }