给定HTML中的以下代码:
<body>
<pre class="typescript">
<span class="classDecl">
<span class="statement">export</span>
<span class="keyword">class</span>
<span class="identifier">Sample</span>
<span id="open1">{</span>
<span class="keyword">private</span>
<span class="marked">
<span class="identifier">name</span>:
<span class="type">string</span>
</span>;
<span class="ctorDecl">
<span class="keyword">constructor</span>
<span id="open2">(</span>
<span class="marked">
<span class="identifier unused">name</span>:
<span class="type">string</span>
</span>
<span id="close2">)</span>
<span id="open3">{</span>
<span class="keyword">this</span>.
<span class="identifier">name</span> =
<span class="error">
<span class="identifier">name1</span>
</span>;
<span id="close3">}</span>
</span>
<span class="methodDecl">
<span class="identifier">greeting</span>
<span id="open4">(</span>
<span id="close4">)</span>:
<span class="type">string</span>
<span id="open5">{</span>
<span class="statement">return</span>
<span class="stringliteral">"Hello "</span> +
<span class="keyword">this</span>.
<span class="identifier">name</span>;
<span id="close5">}</span>
</span>
<span id="close1">}</span>
</span>
</pre>
</body>
我正在尝试选择:,;,=和+符号,但我不知道怎么做。(一个在第8行)
我试着用谷歌搜索,但没有一个答案起作用。
1条答案
按热度按时间tkclm6bt1#
以下解决方案适用于6个css类和一些分层特性
https://jsfiddle.net/tadpole/pthgxqny/1/