asp.net checkboxlist the minimum width CSS styles (compatibility Good) _ Practical tips

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.