谁会将富文本编辑器代码插入到html页面中
1个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>在页面中添加一个富文本编辑器kindeditor</title>
<!--start kindeditor-->
<style>
form {
margin: 0;
}
textarea {
display: block;
}
</style>
<!--引用路径正确与否决定kindeditor是否被成功引用-->
<link rel="stylesheet" href="kindeditor/themes/default/default.css"/>
<script charset="utf-8" src="kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script>
KindEditor.ready(function(K) {
window.editor = K.create('#editor_id');
});
</script>
<!--end kindeditor-->
</head>
<body class="">
<div><h>回复话题</h></div>
<div>
<form action="" method="post">
<!--编辑器editor 这个id="editor_id"是上面KindEditor.ready(function(K));函数创建一个
文本编辑框来替换textarea需要用到的id-->
<textarea id="editor_id" name="content" style="width:700px;height:300px;">
<strong>HTML内容</strong></textarea>
<div>
<button type="submit">发表</button>
<button type="reset">取消</button>
</div>
</form>
</div>
</body>
</html>
备注:这里需要引用kindeditor包,这个包可以在kindeditor的官网下载,官网上有
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>在页面中添加一个富文本编辑器kindeditor</title>
<!--start kindeditor-->
<style>
form {
margin: 0;
}
textarea {
display: block;
}
</style>
<!--引用路径正确与否决定kindeditor是否被成功引用-->
<link rel="stylesheet" href="kindeditor/themes/default/default.css"/>
<script charset="utf-8" src="kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script>
KindEditor.ready(function(K) {
window.editor = K.create('#editor_id');
});
</script>
<!--end kindeditor-->
</head>
<body class="">
<div><h>回复话题</h></div>
<div>
<form action="" method="post">
<!--编辑器editor 这个id="editor_id"是上面KindEditor.ready(function(K));函数创建一个
文本编辑框来替换textarea需要用到的id-->
<textarea id="editor_id" name="content" style="width:700px;height:300px;">
<strong>HTML内容</strong></textarea>
<div>
<button type="submit">发表</button>
<button type="reset">取消</button>
</div>
</form>
</div>
</body>
</html>
备注:这里需要引用kindeditor包,这个包可以在kindeditor的官网下载,官网上有
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询