这是我标记的 HTML 代码,但每当我加载页面时,选择标签都不会出现。我相信我已经包含了所有必要的链接,当我从 select 标记中删除 .selectpicker 类时,它会正常显示,所以我一定错过了为什么它没有出现。谢谢!
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/css/bootstrap-select.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/bootstrap-select.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/i18n/defaults-*.min.js"></script>
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<select class="selectpicker" style="btn-info">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
<script>
$('.selectpicker').selectpicker({
style: 'btn-info',
size: 4
});
</script>
</body>
</html>