我正在尝试实现 bootstrap-wysihtml5编辑器,但没有任何按钮显示样式:
我包含来自 gitrepo 下载的 wysihtml5 的脚本, bootstrap-wysihtml5 ,以及 official bootstrap documentation .
<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>wysihtml5</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/bootstrap-wysihtml5.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
body {
padding-top: 70px;
}
</style>
</head>
<body>
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<h4 class="panel-title">wysihtml5</h4>
</div>
<div class="panel-body">
<form method="post" action="submit-content.php">
<div class="form-group">
<textarea id="wysihtml5" class="form-control" rows="20" placeholder="Enter text..."></textarea>
</div>
<div class="form-group text-right">
<button type="submit" class="btn btn-primary">Create Article</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/wysihtml5-0.3.0.min.js"></script>
<script src="js/bootstrap-wysihtml5.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#wysihtml5').wysihtml5();
});
</script>
</body>
</html>
最佳答案
这些按钮缺少 btn-default
类,因为 Bootstrap 3 中需要它。
您可以提供按钮模板like shown in documentation ,或者随后通过 jQuery 添加类。
或者更好的是 fork 该项目并将其更新到 bootstrap 3,然后考虑向原始存储库发出拉取请求。
关于javascript - wysihtml5 编辑器 - 不设置按钮样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22987544/