使用图像HTML向按钮添加文本
我有一个按钮,它最初是一个图像,单击时执行一个操作。但是,我想添加标题提交到按钮 我怎么能这样做使用图像HTML向按钮添加文本,html,css,Html,Css,我有一个按钮,它最初是一个图像,单击时执行一个操作。但是,我想添加标题提交到按钮 我怎么能这样做 <form name="input" action="" method="post"> <input type="text" name="emailaddress" placeholder="email address" class=emailInput /> <button type="submit" style="border: 0; background: tra
<form name="input" action="" method="post">
<input type="text" name="emailaddress" placeholder="email address" class=emailInput />
<button type="submit" style="border: 0; background: transparent">
<img src="submit.png" width="50" height="31" class=submitButton alt="Submit" />
</button>
</form>
最好的方法是使用CSS,因为我认为图像实际上是文本的背景
- 从按钮内部移除图像
- 使用css装饰按钮
- 将文本放置在按钮中
button {
background:transparent url(submit.png) no-repeat left top;
width:50px;
height:31px;
}