我有一个用户可以写一些代码的textarea表单。我用CodeMirror代码编辑器替换了该textarea,所以我想将Bootstrap样式应用到它。将Twitter Bootstrap样式应用于CodeMirror?
这是形式是什么样子,现在,这里除了代码编辑器中的所有表单元素具有引导花式:
所以特别,我想我需要给代码编辑器圆角,边框,正确的宽度(input-xxlarge)以及鼠标悬停时的蓝色高光。
我该怎么做?有没有办法做到这一点,除了手动复制必要的CSS?
UPDATE
我试图复制在从引导textarea的CSS,当我点击代码编辑器内的一切看起来除了重点CSS不错。这就是我得到:
的亮点是不是外面在里面。任何想法如何解决这个问题?
这是我加入通过从自举复制CSS:
.CodeMirror {
line-height: 1.3em;
font-family: monospace;
/* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
position: relative;
/* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
overflow: hidden;
background-color: white;
width: 530px;
/* Copied from Bootstrap's textarea */
display: inline-block;
padding: 4px 6px;
margin-bottom: 9px;
color: #555555;
border: 1px solid #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
}
.CodeMirror-focused {
/* Copied from Bootstrap's textarea */
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
/* IE6-9 */
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
复制你的代码,它似乎为我工作没有任何变化,或者你可能修复它.. –