簡體   English   中英

使asp.net按鈕控件的角變圓

[英]Make the corners of asp.net Button Control Rounded

在我的自定義Webpart中,我使用了幾個按鈕,希望使它們的角變圓。

以下是我在ascx文件中的按鈕之一:

 <style type="text/css">
   {
   .BtnStyle
   {
    border: thin ridge #FF0000; 
    background-color: #C0C0C0; 
    font-family: verdana; 
    font-size: 8pt; 
    font-weight: bold; 
    color: #FF0000;
    border-top-left-radius: 10px 5px; --- did not work 
    border-bottom-right-radius: 10% 5%; --did not work 
    border-top-right-radius: 10px; -- did not work 
    -moz-border-radius: 15px; --- did not work 
    -webkit-border-radius: 15px; --- did not work 
    border-radius: 15px; --- did not work and gives an error saying not a valid CSS property

}
}

<table width="500px">
<tr>
<td align="right"  >
<table width="60%">
<tr>
    <td  valign="middle" align="right">
        <asp:Button ID="bttn1" runat="server" onclick="bttn1_Click" 
            Text="Delete" CssClass="BtnStyle" />
    </td>

沒事。 請向我提供CSS代碼,以幫助我弄圓角。

正確的屬性應為:

border-radius:15px;

您可以刪除供應商前綴,因為所有現代瀏覽器現在都接受該標准。 我不知道為什么在您的情況下不起作用,但是我將檢查輸出以查看類是否存在或樣式是否已刪除。

您的編輯器無法識別CSS3屬性,因此將其標記為無效。 這並不意味着它實際上是無效的,因為現代瀏覽器會對其進行解析。

還請記住,任何低於9的IE版本都不支持邊界半徑。 您可以使用http://css3pie.com/來使IE7和IE8支持它,但是我認為最好不要使用它,並為現代瀏覽器保留一些花哨的東西,除非客戶要求。

編輯:您有太多花括號。 刪除第一個和最后一個。 此外,您的樣式標簽未關閉。

您正在使用哪個瀏覽器? ie9之前的IE版本不支持邊界半徑,因為該標記被視為高級CSS屬性。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM