hyperlinks and images

G

Guest

How do I size an image attached to a hyperlink? Or How can I add a hyperlink
to an image that is resizable?
 
N

Nathan Sokalski

I believe that you would use the width & height properties just like you
would any image.
 
G

Guest

Sorry Nathan, that doesn't work. It resizes the hyperlink control but not the
image. And if the image is bigger than the width/height specified it will be
overriden to the images specs.

BTW....I'm using VS2005 ASP.Net 2.0
 
G

Guest

Sarah,

Add in the styles section a descendant selector definition for an img within
the hyperlink like this:
<style>
.HyperLinkedImage1 img{
width:30%;
}
</style>

<asp:HyperLink ID="HyperLink1" Runat="server" ImageUrl="Image1.jpg"
CssClass="HyperLinkedImage1"></asp:HyperLink>
 
G

Guest

Hi Philip,

Thanks for this. I actually ended up greating the cssclass with 100% which
allowed the image to change dynamically as the hyperlink control was resized.
Not sure why it worked but it did and I'm not arguing with it. Got love that
..NET.

Thanks,
Sarah
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top