【问题标题】:Radio buttons and checkbox is not working in material design单选按钮和复选框在材料设计中不起作用
【发布时间】:2016-01-07 05:40:18
【问题描述】:

引导材料设计复选框、单选按钮和切换按钮未根据以下代码中的材料设计进行样式设置,请帮助我。

<link href="css/bootstrap-material-design.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />

<link href="css/jquery-ui.min.css" rel="stylesheet" />
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/material-fullpalette.min.css" rel="stylesheet" />

<link href="css/ripples.min.css" rel="stylesheet" />
<link href="css/material-design-iconic-font.min.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />
<div class="form-group" style="margin-top: 0;">
  <!-- inline style is just to demo custom css to put checkbox below input above -->
  <div class="col-md-offset-2 col-md-10">
    <div class="checkbox">
      <label>
        <input type="checkbox">Checkbox
      </label>
      <label>
        <input type="checkbox" disabled="">Disabled Checkbox
      </label>
    </div>
  </div>
</div>
<div class="form-group">
  <div class="col-md-offset-2 col-md-10">
    <div class="togglebutton">
      <label>
        <input type="checkbox" checked="">Toggle button
      </label>
    </div>
  </div>
</div>
<div class="col-md-10">
  <div class="radio radio-primary">
    <label>
      <input type="radio" name="optionsRadios" id="Radio1" value="option1" checked="">Option one is this
    </label>
  </div>
  <div class="radio radio-primary">
    <label>
      <input type="radio" name="optionsRadios" id="Radio2" value="option2">Option two can be something else
    </label>
  </div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/material.min.js"></script>
<script src="js/ripples.min.js"></script>

【问题讨论】:

    标签: css twitter-bootstrap-3 material-design bootstrap-material-design


    【解决方案1】:

    你需要像这样初始化材料设计插件:

    $.material.init();
    

    这将注入为复选框、单选等设置样式所必需的元素。在加载所有库文件后包含它。

    【讨论】:

      猜你喜欢
      • 2023-04-05
      • 2017-02-01
      • 2015-07-17
      • 2019-10-26
      • 2017-11-04
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 2021-09-14
      相关资源
      最近更新 更多