Thursday, June 28, 2007

ASP.NET 2.0 and red box appearing

Ran into an issue today with a red box appearing inside of an <input type="image"> tag (which I rarely, if ever, use).  Anyway, I had it set up to use a css class that had a background-image declaration.  Apparently, there is an issue/bug with the <input type=image> tag in that you have to specify a "src=" value in the HTML to get an image to display.
 
Therefore, this will display a broken image link and does not work:
 
css declaration:
.imagelink {
  background-image: url(foo.gif);
  width:20px;
  height:20px;
}
 
html:
<input type=image class=imagelink/>
 
This does work:
<input type=image src=foo.gif />
shannon norrell


Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel
to find your fit.

No comments: