我SimpleMDE
在我的页面上用作编辑器。代码如下:
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="description" content=""/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="shortcut icon" href="{% static 'img/favicon.png' %}"/>
<link rel="stylesheet" href="{% static 'css/reset.css' %}"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.12/css/all.css" integrity="sha384-G0fIWCsCzJIMAVNQPfjH08cyYaUtMwjJwqiRKxxE/rx96Uroj1BtIQ6MLJuheaO9" crossorigin="anonymous">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<link rel="stylesheet" href="{% static 'css/fonts.css' %}"/>
<link rel="stylesheet" href="{% static 'css/main.css' %}"/>
<link rel="stylesheet" href="{% static 'css/media.css' %}"/>
<link rel="stylesheet" href="{% static 'css/jquery.tagit.css' %}"/>
<link rel="stylesheet" href="{% static 'css/tagit.ui-zendesk.css' %}"/>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
<script src="{% static 'js/markjax.min.js' %}"></script>
</head>
<body>
<div class="main">
<div class="container">
<div class="main_content">
<div class="row">
<div class="main_page_content">
<div class="wall">
<div class="box_roundbox">
<div class="padd_box05">
<form method="post" id="task_create_form">
Description:
<div class="padd_box_top1" name="description">
<textarea name="description" class="task_create_textarea">{{ task.description }}</textarea>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
if ($(".task_create_textarea").length) {
var task_create_textarea_mde = new SimpleMDE({ element : $(".task_create_textarea")[0], spellChecker: false, previewRender: function(plainText, preview) {
setTimeout(function() {
markjax(plainText, preview);
}, 50);
return preview.innerHTML;
} });
}
</script>
</body>
CSS类:
.main {
padding-top: 3em;
}
.row {
margin-left: 0;
margin-right: 0;
}
.wall {
flex-basis: 0;
flex-grow: 3;
margin-right: 2em;
}
.box_roundbox {
border: 0.15em solid #AAAAAA;
border-radius: 0.5em;
}
.padd_box05 {
padding: 0.5em;
}
.padd_box_top1 {
padding-top: 1em;
}
我的问题是:当我在textarea
generate by中输入很长的字符串时SimpleMDE
,它只是无法控制地放大。如何禁用水平调整大小padd_box_top1
?我试过resize: none;
了,但没有任何改变。