2013-02-28 66 views
1

我有一張桌子,上面有一些CSS,用於在第一行(對於列標題)中使用圓角和漸變背景進行樣式表,但儘管如此,我指定overflow: hidden;帶有圓角和漸變背景的HTML表格

HTML:

<table id="tblIncidentQueue" class="DataTable"> 
     <tr class="TableHeaderFooter"> 
      <td colspan="5"> 
       <strong>Show </strong> 
       <asp:DropDownList ID="drpNumOfResults" runat="server"> 
        <asp:ListItem Text = "10" Value="10" ></asp:ListItem> 
        <asp:ListItem Text = "20" Value="20" ></asp:ListItem> 
        <asp:ListItem Text = "50" Value="50" ></asp:ListItem> 
        <asp:ListItem Text = "100" Value="100" ></asp:ListItem> 
        <asp:ListItem Text = "All" Value="All" ></asp:ListItem> 
       </asp:DropDownList> 
       <strong> entries</strong> 
      </td> 
      <td align="right"> 
       <img src="../images/Icons/Refresh.png" border="0" /> 
       <img src="../images/Icons/Down.png" border="0" /> 
      </td> 
     </tr> 
    </table> 

CSS:

.DataTable 
{ 
    margin: 10px; 

    -moz-border-radius : 10px; /* Firefox */ 
    -webkit-border-radius : 10px; /* Safari & Chrome */ 
    -khtml-border-radius : 10px; /* Linux browsers */ 
    border-radius : 10px; /* CSS3 compatible browsers */ 

    border-style: solid; 
    border-width: 1px; 
    border-color: #cccccc; 
    padding: 0px; 
    border-spacing: 0px; 
    overflow: hidden; 
} 

.TableHeaderFooter 
{ 
    background: #eeeeee; /* Old browsers */ 
     background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */ 
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */ 
     background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */ 
     background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Opera 11.10+ */ 
     background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* IE10+ */ 
     background: linear-gradient(to bottom, #eeeeee 0%,#cccccc 100%); /* W3C */ 
     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0); /* IE6-9 */ 
     overflow: hidden; 
} 

任何幫助,不勝感激!

+0

這是在一個特定的瀏覽器?或在所有瀏覽器? – PlantTheIdea 2013-02-28 17:47:35

+3

如果您提供生成的HTML,最好還使用演示(請參閱:http://jsfiddle.net/),對我們來說,幫助您更容易。 – cimmanon 2013-02-28 17:50:10

回答

0

您必須爲TableHeaderFooter中的那些td元素設置屬性border-radius

.TableHeaderFooter td:first-child { 
    border-radius : 10px 0px 0px 10px; /* rounds the top and bottom left corner */ 
} 

.TableHeaderFooter td:last-child { 
    border-radius : 0px 10px 10px 0px; /* rounds the top and bottom right corner */ 
} 

現在你不應該看到任何溢出的背景,例如梯度(注意overflow屬性在這種情況下是沒用的)

我希望它能幫助

0

將.TableHeaderFooter的所有後臺代碼放入.DataTable中。 邊緣會消失。

.DataTable { 
    margin: 10px; 
    -moz-border-radius : 10px; /* Firefox */ 
    -webkit-border-radius : 10px; /* Safari & Chrome */ 
    -khtml-border-radius : 10px; /* Linux browsers */ 
    border-radius : 10px; /* CSS3 compatible browsers */ 
    border-style: solid; 
    border-width: 1px; 
    border-color: #cccccc; 
    padding: 0px; 
    border-spacing: 0px; 
    overflow: hidden; 
    background: #eeeeee; /* Old browsers */ 
    background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */ 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */ 
    background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */ 
    background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Opera 11.10+ */ 
    background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* IE10+ */ 
    background: linear-gradient(to bottom, #eeeeee 0%,#cccccc 100%); /* W3C */ 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0); /* IE6-9 */ 
} 

.TableHeaderFooter { 

} 
+0

那是你想要的嗎? – Nworks 2013-02-28 17:55:45

+0

嗨 - 謝謝,我不希望整個表格中的漸變 - 但會有額外的行,我不希望漸變。 – Pseudo 2013-02-28 18:07:02

+0

是否必須包含ASP?你可以通過做一個ul列表來取得你的結果。 – Nworks 2013-02-28 18:11:27