创建图像用作按钮 [英] Making an image act like a button

查看:129
本文介绍了创建图像用作按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个简单的HTML页面,在这里我有这样的形象,我想作为一个按钮。

I'm working on a simple HTML page where I have this image that I want to act as a button.

下面是code代表我的形象:

Here is the code for my image:

<div style="position: absolute; left: 10px; top: 40px;"> 
    <img src="logg.png" width="114" height="38">
</div>

基本上我想这个功能添加到它:

And basically I want to add this functionality into it:

<div>
    <input id="saveForm" name="saveForm" class="btTxt submit" type="submit" value="Submit"/>
</div>

上说,提交不需要为我的形象按钮本身的文本有它需要的文本。

The text on the button itself that says Submit is not needed as my image has the text it needs.

所以无论如何,这可能吗?如果是这样,怎么样? :)

So anyway, is this possible? and if so, How? :)

推荐答案

这听起来像你想的图片按钮:

It sounds like you want an image button:

<input type="image" src="logg.png" name="saveForm" class="btTxt submit" id="saveForm" />

另外,您也可以使用CSS,使现有的提交按钮使用图像作为背景。

Alternatively, you can use CSS to make the existing submit button use your image as its background.

在任何情况下,你的希望有一个单独的&LT; IMG /&GT; 的元素页。

In any case, you don't want a separate <img /> element on the page.

这篇关于创建图像用作按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆