2014-03-26 129 views
0

我剛剛涉足在Visual Studio中創建一個Web表單2012使ASP.NET Web窗體按鈕看起來像一個Windows窗體按鈕

,當我把它拖到從我的表格按鈕的默認外觀工具托盤和運行表單只是平坦的。運行表單時,它不會基於被啓用或禁用來改變外觀。 「推」它顯示外觀沒有變化。換句話說,它不如以同樣方式創建的Windows窗體按鈕好。

是否需要編寫一些CSS代碼或其他內容才能更改?

(用於調試我的默認瀏覽器是Firefox瀏覽器。)

+1

是的,你將不得不添加一些CSS來按照你想要的樣式設置按鈕的樣式。 – Humpy

+0

http://www.cssbuttongenerator.com/ - 那很難。 – EkoostikMartin

回答

1

您可以使用CSS自定義按鈕。 jsfiddle.net/8cqcF

enter image description here

<style type="text/css"> 
    .submit { 
     border: 1px solid #563d7c; 
     border-radius: 5px; 
     color: white; 
     padding: 5px 10px 5px 25px; 
     background-image: url(https://cdn.sstatic.net/stackoverflow/img/sprites.png?v=6); 
     background-position-y: 465px; 
     background-position-x: 5px; 
     background-color: #563d7c; 
    } 
</style> 

<asp:Button runat="server" ID="Button1" Text="Submit" CssClass="submit"/> 

Thesedays,很多人使用的前端框架,如Bootstrap

Here是引導按鈕的示例。

enter image description here