N
Nathan Sokalski
I have several HyperLink controls on my site in which I use the ImageUrl
property to display them as an image. This generates something like the
following:
<a><img/></a>
I would like to specify the height and width of the image, but if I use the
HyperLink's Height and Width properties, something like the following is
generated:
<a style="display:inline-block;height:100px;width:100px;"><img/></a>
My basic problem here is that there is no way to add style to the image.
Yes, I know that I could make the HyperLink and image separate controls or
create a CSS class that uses a child selector. But we all know that it is
good practice to set the width and height of images, so why did they give
the HyperLink an ImageUrl property if you can't specify it's width and
height? In my opinion, the HyperLink is very poorly designed when it comes
to creating graphical hyperlinks.
property to display them as an image. This generates something like the
following:
<a><img/></a>
I would like to specify the height and width of the image, but if I use the
HyperLink's Height and Width properties, something like the following is
generated:
<a style="display:inline-block;height:100px;width:100px;"><img/></a>
My basic problem here is that there is no way to add style to the image.
Yes, I know that I could make the HyperLink and image separate controls or
create a CSS class that uses a child selector. But we all know that it is
good practice to set the width and height of images, so why did they give
the HyperLink an ImageUrl property if you can't specify it's width and
height? In my opinion, the HyperLink is very poorly designed when it comes
to creating graphical hyperlinks.