On Monday, November 2, 2009 7:04:13 pm Jack Bates wrote:
> I have a web application that I hope to style entirely with CSS, if
> possible
>
> The application includes a submit button, <input type="submit"
> value="Search" />
>
> I want to replace this button with an image, so I tried the following
> CSS,
>
> input
> {
> background-color: transparent;
> background-image: url('index.png');
> background-repeat: no-repeat;
> border-style: none;
> height: 33px;
> width: 38px;
> }
>
> This works great, except that the image still has the text "Search" over
> top : (
>
> Here's an example, http://www.sfu.ca/~jdbates/tmp/css/200911020/
>
> Any advice how to replace this button with an image, without the text
> "Search" over top? - or advice how the web application could be changed
> such that this is achievable entirely with CSS?
Two things come to mind. The first is to set the value attribute to be either
empty or white space, so it doesn't write anything over your image.
The second is to make the image a submit button (rather than making the submit
button an image) something like:
<form name="form_name">
<img alt="Search" src="index.png"
onclick="document.form_name.submit();">
</form>
---Tim
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/