控制cms:CMSDropDownList的width

  查找了一下kentico内部使用相关控件的代码,发现有2种方式,可以达到效果。

  • 在我们自己的css class定义的地方,在class前面加上.cms-bootstrap

.cms-bootstrap .DropDownList200 {width: 214px;border: #ababab 1px solid;text-align: left;}

     示例

   <cms:CMSDropDownList ID="ddlDataType" runat="server" CssClass="DropDownList200">
  • 使用kentico内置的width相关的css class

 

.cms-bootstrap .input-width-15 {

  width: 48px;

}

.cms-bootstrap .input-width-20 {

  width: 80px;

}

.cms-bootstrap .input-width-40 {

  width: 112px;

}

.cms-bootstrap .input-width-60 {

  width: 192px;

}

.cms-bootstrap .input-width-100 {

  width: 320px;

}

.cms-bootstrap .input-width-82 {

  width: 264px;

}

.cms-bootstrap .input-width-58 {

  width: 176px;

}

示例

  <cms:CMSDropDownList ID="ddlDataType" runat="server" CssClass="input-width-100">
原文地址:https://www.cnblogs.com/chucklu/p/9894882.html