Html 向窗体按钮添加图标

Html 向窗体按钮添加图标,html,ruby-on-rails,css,button,Html,Ruby On Rails,Css,Button,我使用以下代码将图标放置在按钮顶部: <a href="/users/hide_profile" class="button"> <span class="hide_profile">hide public profile</span> </a> a.button{ background-image: url('/images/button.gif'); display:inline-block; posi

我使用以下代码将图标放置在按钮顶部:

    <a href="/users/hide_profile" class="button">
      <span class="hide_profile">hide public profile</span>
    </a>

a.button{
  background-image: url('/images/button.gif');
  display:inline-block;
  position: relative;
  _display: inline;
  color:#888888;
  font-weight:bold;
  height:30px;
  line-height:29px;
  margin-bottom:14px;
  text-decoration:none;
  width:191px; }
a:hover.button{ color:#0066CC; }

.hide_profile{
  background-image: url('/images/icons/hide.png');
  background-repeat: no-repeat;
  background-position:7px 6px; 
  font-size: 14px;
  text-indent:30px;
  display:block;
}

a、 钮扣{
背景图像:url('/images/button.gif');
显示:内联块;
位置:相对位置;
_显示:内联;
颜色:#888888;
字体大小:粗体;
高度:30px;
线高:29px;
边缘底部:14px;
文字装饰:无;
宽度:191px;}
a:悬停。按钮{颜色:#0066CC;}
.hide_profile{
背景图像:url('/images/icons/hide.png');
背景重复:无重复;
背景位置:7px 6px;
字体大小:14px;
文本缩进:30px;
显示:块;
}
我正在使用RubyonRails,我想知道如何为表单提交按钮做到这一点。有什么想法吗?

你可以

<input type="image" src="url-where-your-image-lives" onclick="Element.up(this, 'form').submit()"> 这假设您使用的是原型JavaScript库,这似乎很可能,因为您使用的是RoR