html - 类不适用于提交按钮

标签 html ruby-on-rails css

我正在尝试将一个类应用于以下提交按钮 代码:

<input type="submit" value="Submit" name="commit" class="confirm-button-submit ">

样式:

.confirm-button-submit 
{
   width    : 79px;
   font      : bold 12px sans-serif;;
   color    : #000;
   background    : url("../images/confirm-btn.png") 0 -33px no-repeat;
   text-decoration : none;
   margin-top    :0px;
   text-align:center;
   border:0px;
   cursor : pointer;
   height:170px;
}


.confirm-button-submit a
{
   width    : 79px;
   font      : bold 12px sans-serif;;
   color    : #000;
   background    : url("../images/confirm-btn.png") 0 -33px no-repeat;
   text-decoration : none;
   margin-top    :0px;
   text-align:center;
   border:0px;
   cursor : pointer;
   height:170px;
}



.confirm-button-submit a:hover
{
   width    : 79px;
   font      : bold 12px sans-serif;;
   color    : #000;
   background    : url("../images/confirm-btn.png") 0 0 no-repeat;
   text-decoration : none;
   margin-top    :0px;
   text-align:center;
   border:0px;
   cursor : pointer;
   height:170px;
}

但是它不能正常工作怎么办

谢谢

最佳答案

我假设您打算应用 .confirm-button-submit 的 CSS 规则,但您的按钮没有该类。

你必须使用:

<input type="submit" value="Submit" name="commit" class="confirm-button-submit" />

关于html - 类不适用于提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3007813/

相关文章:

html - 如何使用 bootstrap 3 制作响应式 Accordion 布局?

html - 无论窗口大小如何,如何在所有浏览器中平等地定位表单元素。

ruby-on-rails - 如何使部分代码仅针对特定集合显示

ruby-on-rails - 事件管理员 : Form with datepicker on custom page

ruby-on-rails - 将应用程序从随机显示一个报价切换为网格中的所有报价

css - Rails 4 字体在 Apache 上的生产中预编译后不呈现

html - 内联显示包含 P block 的 DIV

javascript - AngularJS 中的动画(改变颜色)

CSS如何让按钮显示图像

html - 在特定浏览器宽度下,渐变填充 div 的末尾出现白线