sublime skill to write code fast

After the sublime upload the plugin Emmet, we can use the following technique to quickly write code

1, the header file is automatically generated html

html: 5 or:! doctype for HTML5

html: xt: document type for XHTML Transitional

html: 4s: for HTML4 strict document type

For example, input html: 5 and then press Tab, will automatically html file header completion

2, quick filling classes, id

Continuous input element name and ID, Emmet will auto-complete as you, such as input p # example pressing the Tab key will get

<p id="example"></p>

Input div.cls # con press Tab to give

<div class="cls" id="con"></div>

3, defining a plurality of elements

Such as input ul> li * 3 will be

<ui>
  <li></li>
  <li></li>
  <li></li>
 </ui>

4, nesting

Now you only need one line of code can be achieved nested labels.

    • >: Child element symbols represent nested elements
    • +: Label Symbol peer
    • ^: You can make the label before lifting his party symbol

For example, enter div # con> div get

<div id="con">
  <div></div>
 </div>

5, with a plurality of elements nested definitions of the class or id

For example: ul.d1> li # d2 $ * 3 will be

<ul class="d1">
  <li id="d21"></li>
  <li id="d22"></li>
  <li id="d23"></li>
 </ul>

Guess you like

Origin www.cnblogs.com/bigbighu/p/11130048.html