c# - 样式 <asp :Button/> with CSS

标签 c# html asp.net css

我有一个 asp:Button,我在 asp:Button 中使用了带有 cssClass 属性的 css 样式,但这些样式不起作用。

这是我的 asp 按钮:

<tr>
    <td>
        <div class="form_row">
             <asp:Button ID="ButtonSend" CssClass="BtnSend" runat="server" Text="Send" OnClick="ButtonSend_Click" />
        </div>
    </td>
</tr>

这是我的 CSS:

.BtnSend {
  width: 53px;
  height: 24px;
  display: block;
  float: right;
  margin: 0 0 0 10px;
  background: url(../../Images/contact_bt.gif) no-repeat center;
  text-decoration: none;
  text-align: center;
  line-height: 24px;
  color: #fff;
}

如果我没记错的话,我应该使用这样的东西:

input[type="submit"]
{
 //css coding
}

但我不知道把它放在哪里以及如何只影响这个按钮。

最佳答案

根据您的评论,在您的 CSS 中添加/更改它:

.BtnSend {
  border: none;
  background: transparent url(../../Images/contact_bt.gif) no-repeat center;
}

关于c# - 样式 <asp :Button/> with CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22174016/

相关文章:

c# - Lambda 表达式和可空类型

c# - NHibernate 查询

javascript - 如何创建 JS 切换(向上/向下)标题?

html - 在我的下拉导航栏布局中出现一个奇怪的字符

asp.net - Linq to Entity(EF 4.1) 的匿名类型?

c# - 在构建时将 ASPX 中的字符串替换为构建版本

c# - 获取列表所有索引的所有结果

c# - 以单词结尾的字符串的前 180 个字符

html - 并排对齐两个 div,覆盖整个页面宽度

Asp.net 页面生命周期 page_loadComplete