2009-11-20 80 views
0

我有我想要的風格元素:如何防止ASP.NET添加到內聯樣式中?

<tr runat="server" id="row" > 
... 
</tr> 

我編程設置樣式:

row.Attributes("style") = "background: #cccccc;" 

我得到這樣的輸出:

<tr id="SearchResults_myRepeaterPlain_ctl04_row" style="background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"> 

哪裏是所有來自哪些額外的風格信息,以及如何阻止它?

回答

3

我的直覺是因爲你只使用背景。它將爲背景添加所有其他值。嘗試使用背景顏色:

+0

+1,請參閱CSS背景屬性的文檔:http://www.w3schools.com/css/pr_background.asp。 –

+0

切換到背景色確實確實解決了問題。 –

相關問題