在Emmet中使用不同的兄弟标签包装多行文本

问题描述 投票:0回答:2

有没有办法使用Emmet突出显示并包装以下行:

This is a title
This is a subtitle
This is the sentence below the subtitle.

所以它会输出:

<h2>This is a title</h2>
<h3>This is a subtitle</h3>
<p>This is the sentence below the subtitle.</p>

我试过了:

h2+h3+p

但是那个输出:

<h2></h2>
<h3></h3>
<p>This is a titleThis is a subtitleThis is the sentence below the subtitle.</p>
html emmet
2个回答
1
投票

试试这个:

h2{This is a title}+h3{This is a subtitle}+p{This is the sentence below the subtitle.}

JS Fiddle :(只需在行尾按Tab键:)

http://jsbin.com/qelenuda/1/edit


0
投票

不,这是不可能的。在这种情况下,单独包装每一行的速度要快得多,而不是单一缩写的新语法。

© www.soinside.com 2019 - 2024. All rights reserved.