如何设置css规则,以便在html代码标记中格式化注释?
类似regex //.*
<pre>
<code>
git reset [file] //unstage but preserve file content
...
</code>
</pre>发布于 2021-11-23 17:22:11
您可以将注释放在标记中:
.comment {
color:grey;
/*Your CSS here*/
}<script src="https://css-library.hg0428.repl.co/script.js"></script>
<pre>
<code>
git reset [file] <span class="comment">//unstage but preserve file content</span>
...
</code>
</pre>
如果您不想使用标记,那么您将需要使用JavaScript循环遍历所有代码标记,定位注释,并应用类。
https://stackoverflow.com/questions/70085028
复制相似问题