473,320 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

hyperlinks and images

How do I size an image attached to a hyperlink? Or How can I add a hyperlink
to an image that is resizable?
Feb 27 '06 #1
4 960
I believe that you would use the width & height properties just like you
would any image.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Sarah Sarah" <Sa********@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
How do I size an image attached to a hyperlink? Or How can I add a
hyperlink
to an image that is resizable?

Feb 28 '06 #2
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

"Nathan Sokalski" wrote:
I believe that you would use the width & height properties just like you
would any image.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Sarah Sarah" <Sa********@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
How do I size an image attached to a hyperlink? Or How can I add a
hyperlink
to an image that is resizable?


Feb 28 '06 #3
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>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Sarah Sarah" wrote:
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

"Nathan Sokalski" wrote:
I believe that you would use the width & height properties just like you
would any image.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Sarah Sarah" <Sa********@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
How do I size an image attached to a hyperlink? Or How can I add a
hyperlink
to an image that is resizable?


Feb 28 '06 #4
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

"Phillip Williams" wrote:
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>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Sarah Sarah" wrote:
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

"Nathan Sokalski" wrote:
I believe that you would use the width & height properties just like you
would any image.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Sarah Sarah" <Sa********@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
> How do I size an image attached to a hyperlink? Or How can I add a
> hyperlink
> to an image that is resizable?

Mar 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Imran | last post by:
Hi, I am attempting to create a CSS-driven website, in that I want to be able to control the display/content from the CSS file. I do not want to use tables. On a page, I have a background...
7
by: ii2o | last post by:
Hi guys, I have a problem where IE is refusing tables to made as hyperlinks. I have some CSS code which makes the background glow if is hovered upon and this works fine both in Firefox and IE....
0
by: MisterX | last post by:
Hi, I am trying to embed a link in the rtf textbox control. Has anyone had success doing this? Note, I do not want: http://blahblahblah. I simply want a word or group of words identified as a...
0
by: MisterX | last post by:
Hi, I am looking for help in displaying a hyperlink in the rtf textbox control. The .DetectUrls property will cause standard urls (http://) to become a link, but the text I want as a link is not...
2
by: carlos.cruz | last post by:
Hi, I trying to create dinamicaly hyperlinks, which I manage to do with the following code: Protected Overrides Sub OnPreRender(ByVal e As EventArgs) ctl = New HyperLink ctl.Target =...
1
by: Brett | last post by:
Hi, Here's a strange one: I have built a single page model for a website, that uses 3 panel controls which load usercontrols dynamically, based on the querystring PageMode parameter that you...
4
by: Seefor | last post by:
Hi, I want my text hyperlinks to have a dotted border underneath, so I did this which works fine: a, a:link, a:visited, a:hover, a:active { color: #000; text-decoration: none;
1
by: Robin | last post by:
Hello! I'm having trouble with links and hyperlinks in MS Access 2003 - any help would be great! Question 1! The "insert hyperlink" icon opens a browser window, allows the user to browse...
3
by: fiefie.niles | last post by:
I would like to save a web page to a file and have the hyperlinks work when I bring the file back up. If the web page has a hyperlink like the following <a href="OurWeb/News/abcFile.htm">, after...
3
by: J(ohn|ane) Doe | last post by:
I have many webpages with thumbnail pictures. Each thumbnail is a hyperlink to a large picture. The HTML code is similar to this: Now this worked okay on my old server. I got a new webhost,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.