2009-11-20 30 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

切换到背景色确实确实解决了问题。 –

相关问题