将<button> css样式转换为<asp:button>样式</asp:button> </button>

时间:2014-04-12 04:50:35

标签: asp.net css

我的代码中有<button>,现在我想将其更改为<asp:button>。但更换后,设计太糟糕了!我的意思是一些样式代码在新按钮中不起作用。 你可以在这里看到: http://rogatech.somee.com/search.aspx 蓝色区域中的黑色按钮为<button>,白色区域中的黑色按钮为<asp:button>标记。你会看到所有的东西,如颜色和大小以及鼠标悬停效果都没有显示在新按钮中。 我的代码:

<section class="webdesigntuts-workshop">
    <form action="" method="">          
        <asp:textbox ID="Textbox1" CssClass="textbox" runat="server" placeholder="Search...">   </asp:textbox>          
        <button>Search</button>
    </form>
</section>

式:

.webdesigntuts-workshop button {
    background: #222;
    background: -webkit-linear-gradient(#333, #222);
    background: -moz-linear-gradient(#333, #222);
    background: -o-linear-gradient(#333, #222);
    background: -ms-linear-gradient(#333, #222);
    background: linear-gradient(#333, #222);
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    -o-box-sizing: content-box;
    -ms-box-sizing: content-box;
    box-sizing: content-box;
    border: 1px solid #444;
    border-left-color: #000;
    border-radius: 0 5px 5px 0;
    box-shadow: 0 2px 0 #000;
    color: #fff;
    display: block;
    float: left;
    font-family: 'Cabin', helvetica, arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    height: 20px;
    line-height: 20px;
    margin: 0;
    padding: 0;
    position: relative;
    text-shadow: 0 -1px 0 #000;
    width: 80px;
}   

.webdesigntuts-workshop button:hover,
.webdesigntuts-workshop button:focus {
    background: #292929;
    background: -webkit-linear-gradient(#393939, #292929);  
    background: -moz-linear-gradient(#393939, #292929); 
    background: -o-linear-gradient(#393939, #292929);   
    background: -ms-linear-gradient(#393939, #292929);  
    background: linear-gradient(#393939, #292929);
    color: #5f5;
    outline: none;
}

.webdesigntuts-workshop button:active {
    background: #292929;
    background: -webkit-linear-gradient(#393939, #292929);
    background: -moz-linear-gradient(#393939, #292929);
    background: -o-linear-gradient(#393939, #292929);
    background: -ms-linear-gradient(#393939, #292929);
    background: linear-gradient(#393939, #292929);
    box-shadow: 0 1px 0 #000, inset 1px 0 1px #222;
    top: 1px;
}

如何更改此样式才能使用? 我试图改变:

<asp:button text="search" runat server cssClass="button"/>

并在css中尝试过:     .webdesigntuts-workshop按钮:悬停 改为:

.webdesigntuts-workshop  form button:hover,

但有些款式无法在新按钮中使用!

1 个答案:

答案 0 :(得分:1)

你有一个表格,所以

.webdesigntuts-workshop form button { //here }