如何設定 css 規則以便我可以在 html 代碼標簽內格式化注釋?
像正則運算式 //.*
<pre>
<code>
git reset [file] //unstage but preserve file content
...
</code>
</pre>
uj5u.com熱心網友回復:
您可以將評論放在標簽中:
.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://www.uj5u.com/gongcheng/364589.html
