Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
399 views
in Technique[技术] by (71.8m points)

html - Using an image as a submit button

If I want to make my own clickable buttons, I can do this:

<a href="javascript:;" class="button">Sign up</a>

Where CSS rules for a.button causes the link to be shown as a button. If I apply the same trick to <input type="submit" />, I get the button image but it is shown on top of the default submit button and the cursor doesn't change to a hand like it does on <a> tags.

How can I fix this behavior?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You could use an input type="image" instead.

It is used like this:

<input type="image" src="{your image}" alt="{alternate text}" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...