在webpart里面,我并没有定义partstyle的任何padding= "5 "值,可为什么他会自动生成style= "padding:5px; "呢:
<td class= "WebPartStyle " cellspacing= "0 " cellpadding= "0 "
style= "border-collapse:collapse;padding:5px; ">
<table cellpadding= "0 " cellspacing= "0 ">
我设置了 <asp:WebPartZone Padding= "0 "> ,还是没有用,而 <PartStyle/> 中又没有padding属性.请问大家在哪里设置,可以把padding设为0px;?
/*----------------------------------------------------------------*/
在.CSS文件中,是这样定义的:
.WebPartStyle
{
text-align:left; width:250px; padding:0px;
}
/*----------------------------------------------------------------*/
在default.aspx中是这样定义的:
<asp:WebPartZone ID= "WebPartZone1 " title runat= "server " BorderWidth= "0px "
HeaderText= " " Padding= "0 ">
<PartTitleStyle CssClass= "WebPartTitle " />
<PartStyle CellSpacing= "0 " CellPadding= "0 " CssClass= "WebPartStyle "/>
<ZoneTemplate>
<uc2:themectrl ID= "Themectrl1 " runat= "server " Title= " " />
</ZoneTemplate>
</asp:WebPartZone>
/*----------------------------------------------------------------*/
在ctrpanel\themectrl.ascx中是这样定义的.
<%@ Control Language= "C# " AutoEventWireup= "true "
CodeFile= "themectrl.ascx.cs " Inherits= "ctrpanel_themectrl " %>
<table cellpadding= "0 " cellspacing= "0 ">
<tr>
<td class= "tabletop "> 主题 </td>
</tr>
<tr>
<td class= "tablect ">
<table cellpadding= "0 " cellspacing= "10 ">
<tr> <td>
<a href= "# "> 选择 </a>
</td> </tr>
</table>
</td>
</tr>
<tr>
<td class= "tablebtm "> </td>
</tr>
</table>
/*----------------------------------------------------------------*/
在生成的HTML代码如下:
<table cellspacing= "0 " cellpadding= "0 " border= "0 "