【问题标题】:Adding an icon to form button将图标添加到表单按钮
【发布时间】:2010-03-02 03:31:26
【问题描述】:

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

    <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;
}

我正在使用 ruby​​ on rails 并且想知道如何为表单提交按钮执行此操作。有什么想法吗?

【问题讨论】:

    标签: html ruby-on-rails css button


    【解决方案1】:

    你可以的

    这假设您使用的是 Prototype JavaScript 库,这似乎很有可能,因为您使用的是 RoR。

    【讨论】:

      猜你喜欢
      • 2019-06-24
      • 2023-04-03
      • 2014-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-04
      • 1970-01-01
      相关资源
      最近更新 更多