Atom Emmet自定义HTML snippets.json多行上的快捷方式元素

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

我正在尝试创建Emmet(+ TAB)快捷方式,我已完成90%。我只是想不通如何使最后的嵌套元素排成一行。标签,输入和结束div标签都在一行上。我想将它们全部放在单独的行中

snippet.json代码

"form+": "section.form-container>div.form-wrapper>form:post>(div.form-group>label+inp)+btn:s"

html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>


  <section class="form-container">
    <div class="form-wrapper">
      <form action="" method="post">
        <div class="form-group"><label for=""></label><input type="text" name="" id=""></div>
        <button type="submit"></button>
      </form>
    </div>
  </section>

试图使其自动看起来像这样

  <section class="form-container">
    <div class="form-wrapper">
      <form action="" method="post">
        <div class="form-group">
          <label for=""></label>
          <input type="text" name="" id="">
        </div>
        <button type="submit"></button>
      </form>
    </div>
  </section>


</body>
</html>
html atom-editor emmet
1个回答
0
投票

在这种情况下,元素布局由inline_breakoutput profile选项控制,该选项对Emmet扩展的所有代码片段全局起作用。您可以将inline_break减小为2,这将导致元素按预期方式布局

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