這個CSS讓我瘋狂。操縱css不會影響所有元素
我有,我把下面的CSS腳本形式:
input, select, textarea
{
color: #082C6B;
padding: 0px;
font-family: Arial;
font-size: 12px;
}
以這樣的形式我也把下面的按鈕:
<asp:Button ID="btnSend" runat="server" class="myButtonText" Style="font-size: 22px; float: left; height: 30px; width: 100px;" OnClick="btnSend_Click" CausesValidation="true" Text="send" />
我也把下面的CSS腳本:
.myButtonShape
{
/* fallback */
background-color: #082c6b;
/*background: url('../images/gradient-strip.png');
background-repeat: repeat-x;*/ /* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#53e0ff), to(#081a40)); /* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #53e0ff, #081a40); /* Firefox 3.6+ */
background: -moz-linear-gradient(top, #53e0ff, #081a40); /* IE 10 */
background: -ms-linear-gradient(top, #53e0ff, #081a40); /* Opera 11.10+ */
background: -o-linear-gradient(top, #53e0ff, #081a40);
/*border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;*/
text-align: center;
cursor: pointer;
color: #cccccc;
text-decoration: none;
}
現在,因爲asp:button
被翻譯爲input
...然後該按鈕獲取我打算用於字段數據的腳本的顏色。 我如何確保該按鈕將獲得'.myButtonShape'類的腳本?有任何想法嗎?
謝謝先進。
哎呀,emberrasing :-)有很好的答案,但當然這是我的錯誤,不聲明合適的班級。非常感謝! – dsb 2012-03-25 13:57:57