使用materialize css时,复选框不会在html页面中呈现。我正在尝试使用materialize css作为我的Django表单。我尝试使用Django表单,但它没有用。所以,我尝试了一个单独的示例html页面。仍然复选框不呈现。我附上了渲染的html页面的截图。可以看到“结婚”复选框没有复选框。我尝试在页面上使用检查器工具,看起来像是一个复选框,但它不可见。
以下是我尝试用来测试功能的示例html代码。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script>
<script>
$( function() {
$('.collapsible').collapsible();
$( "#datepicker" ).datepicker();
} );
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
<div class="container">
<h2>Collapsible Panel</h2>
<p>Click on the collapsible panel to open and close it.</p>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#collapse1">Collapsible panel</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">Panel Body</div>
<div class="panel-footer">Panel Footer</div>
</div>
</div>
</div>
<ul class="collapsible">
<li>
<div class="collapsible-header"><i class="material-icons">filter_drama</i>First</div>
<div class="collapsible-body"><span> ></span></div>
</li>
<li>
<div class="collapsible-header"><i class="material-icons">place</i>Second</div>
<div class="collapsible-body"><span>Lorem ipsum dolor sit amet.</span></div>
</li>
<li>
<div class="collapsible-header"><i class="material-icons">whatshot</i>Third</div>
<div class="collapsible-body"><span>Lorem ipsum dolor sit amet.</span></div>
</li>
</ul>
<div class ="input-field col s12">
<p>
<input id = "married" type = "checkbox" />
<label for = "married">Married</label>
</p>
</div>
</div>
</body>
</html>
答案 0 :(得分:0)
您正在样本HTML页面中使用materialize CSS和bootstrap CSS。据我所知并且已经在物化上工作,bootstrap和materialize碰撞的CSS导致不呈现某些控件。
我知道有些网站使用bootstrap并实现两者,但它们是专门为这些网站制作的,它们不会发生冲突。
如果你想同时使用它们,我建议你去下载一个bootstrap物化模板。我做了同样的事,它对我有用。