Asp. NET, the selection in the CheckBoxList is automatic width, the property does not set the width of the settings.
Refer to the minimum width of the network style,
Copy Code code as follows:
/* Minimum width/
. min_width{min-width:300px;
/* Sets max-width for IE * *
_width:expression (Document.body.clientWidth < 300?) "300px": "Auto");
}
Written as follows:
Copy Code code as follows:
<style>
. ckblsteffect TD
{
min-width:80px;
_width:expression (Document.body.clientWidth < 80?) "80px": "Auto");
}
</style>
Copy Code code as follows:
<asp:checkboxlist id= "Ckblsteffect" runat= "Server" datatextfield= "MC"
repeatdirection= "Horizontal" repeatcolumns= "ten" cssclass= "Ckblsteffect"
Datavaluefield= "ID" ondatabound= "Ckblsteffect_databound" >
</asp:CheckBoxList>
In the Travel 4 compatibility mode (IE7) does not work, carefully look at the expression in the style, how to look at all feel wrong.
Change it to the following style.
Copy Code code as follows:
<style>
. ckblsteffect TD
{
min-width:80px;
Width:expression (This.offsetwidth < 80?) "80px": "Auto");
}
</style>
In IE10, travel 4 speed mode and compatibility mode can display the minimum width, this style in addition to the CheckBoxList, can also be used for div and so on.
If you find that other browsers cannot display the CheckBoxList option minimum width, please let me know.