I am currently highlighting the source on my website using google's prettyprint like below on my website.
<pre class="prettyprint css">
div {
background-color: lightgreen;
width: 300px;
padding: 25px;
border: 25px solid red;
margin: 25px;
}
</pre>
I will already have some code on file but I only want to hightlight that code. How can I highlight the same using codemirror?
as it shown in codemirror.net
create an
<textarea>
element, which will replace yuor current<pre>
tag. set textarea toreadonly
if you prefer no edit.multiple instances selected by a common class name: