YoungBonzi
asked on
Applying a CSS Class to an ASP:Image Tag
I'm having some trouble trying to figure this out.
something in my css like:
.aspImageClass { border:3px solid #666666; }
and in my aspx file:
<asp:Image ID="Image1" runat="server" CssClass="aspImageClass" />
Won't work.
It seems that <asp:Image> tags aren't affected by the css "img {}" instructions either.
Anyone know how to write a CSS class for an ASP:Image tag?
Thanks!
something in my css like:
.aspImageClass { border:3px solid #666666; }
and in my aspx file:
<asp:Image ID="Image1" runat="server" CssClass="aspImageClass" />
Won't work.
It seems that <asp:Image> tags aren't affected by the css "img {}" instructions either.
Anyone know how to write a CSS class for an ASP:Image tag?
Thanks!
ASKER
Ahh, I see. The source does render an HTML img tag, but for some reason the server is adding:
style="border-width:0px;"
Even when I override the img tag in the css file.
style="border-width:0px;"
Even when I override the img tag in the css file.
ASKER
Hmm...you know what, someone else is having the same problem: http://www.webmasterworld.com/microsoft_asp_net/3363448.htm
I have my asp:image in a content placeholder too. Maybe this isn't a 50 point question. But if I have to just change the tag to a regular image tag then perhaps I should delete this?
I have my asp:image in a content placeholder too. Maybe this isn't a 50 point question. But if I have to just change the tag to a regular image tag then perhaps I should delete this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ha! I didn't even see that property. Thank you =)
ASKER
Once I did that, the other instructions in the css class post will work.
The CSS was working earlier too but the tag style would override the style given in class. So the width was being overridden.
Try doing a "View Source" in your browser to see what tags you should REALLY be affecting.