Detailed explanation of the use of Sublime Text plug-in Emmet
Summary:
Installation Please read the previous article Sublime Text-Installation, use it with sublime’s own shortcut keys, and write HTML quickly.
The following are commonly used. For complete information, please see the emmet official documentation.
Generate tags
1. Quickly generate document structure
##!
or
html:5, Quickly generate
HTML5 structure (you need to press the tab key again)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> </body> </html>
html:xt
Generate HTML4 transitional type
html:4s
Generate HTML4 strict type
p#header
<p id="header"></p>
class
tag. Class name, such as:p.title
<p class="title"></p>
nav>ul>li
<nav> <ul> <li></li> </ul> </nav>
p+p+p
<p></p> <p></p> <p></p>
p^p
<p></p> <p></p>
Such as:
ul>li*5
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
Copy after login
8. Generate from Definition<ul> <li></li> <li></li> <li></li> <li></li> <li></li> </ul>
Attribute: [attr]
For example:p[value=1]
<p value="1"></p>
a{Click me}
<a href="">Click me</a>
- Start from 1: add $
p.item${$$}*3
<p class="item1">01</p> <p class="item2">02</p> <p class="item3">03</p>
- Reverse order: $ followed by @-
p.item$@-{$$@-}*3
<p class="item3">03</p> <p class="item2">02</p> <p class="item1">01</p>
- Specify the serial number: you can use @N
p.item$@4{$$@4}*3
<p class="item4">04</p> <p class="item5">05</p> <p class="item6">06</p>
Group: ()
For example:(ul>ol)*3
<ul> <ol></ol> </ul> <ul> <ol></ol> </ul> <ul> <ol></ol> </ul>
comprehensive case
table#tab[value=1].a>tr*3>(td{$$}>span)*3
<table id="tab" value="1" class="a"> <tr> <td>01<span></span></td> <td>02<span></span></td> <td>03<span></span></td> </tr> <tr> <td>01<span></span></td> <td>02<span></span></td> <td>03<span></span></td> </tr> <tr> <td>01<span></span></td> <td>02<span></span></td> <td>03<span></span></td> </tr> </table>
- w10
width<a href="http://www.php.cn/wiki/835.html" target="_blank">: 10px;</a> w10p
width: 10%;w10e
width: 10em;w10x
width: 10xe; - h10
height<a href="http://www.php.cn/wiki/836.html" target="_blank">: 10px;</a>
- por
position<a href="http://www.php.cn/wiki/902.html" target="_blank">: relative;</a> poa
position: absolute; - fll
float<a href="http://www.php.cn/wiki/919.html" target="_blank">: left;</a> fr
float:right<a href="http://www.php.cn/wiki/905.html" target="_blank">;</a>
- dt
display<a href="http://www.php.cn/wiki/927.html" target="_blank">: table;</a> db
display: block;dib
display: inline-block; ##ovy overflow-y
: hidden;<a href="http://www.php.cn/wiki/926.html" target="_blank"></a>
cb -
clear
##mt: both;<a href="http://www.php.cn/wiki/917.html" target="_blank"></a>
- margin-top
: ;
mb <a href="http://www.php.cn/wiki/933.html" target="_blank"></a>margin-bottom
: ;<a href="http://www.php.cn/wiki/935.html" target="_blank"></a>
pt
<a href="http://www.php.cn/wiki/949.html" target="_blank">padding-top</a>: ;
pb<a href="http://www.php.cn/wiki/951.html" target="_blank">padding-bottom</a>: ;
tac
<a href="http://www.php.cn/wiki/870.html" target="_blank">text-align</a>: center;
lh
<a href="http://www.php.cn/wiki/864.html" target="_blank">line-height</a>:;
tsn
<a href="http://www.php.cn/wiki/861.html" target="_blank">text-shadow</a>: none;
tja
<a href="http://www.php.cn/wiki/881.html" target="_blank">text-justify</a>: auto;
c
color: #000;
crcolor: rgb(0, 0, 0);
cracolor: rgba(0, 0, 0, .5);
op
opacity: ;
cnt
content: '';
ol
<a href="http://www.php.cn/wiki/938.html" target="_blank">outline</a>: ;
bd+
border: 1px solid #000;
bdb+border-bottom: 1px solid #000;
bd2px#333s
border: 2px #333 solid;
快捷键
如果没作用请检查快捷键是否冲突
快速生成包裹标签:Ctrl+Shift+G
只有文本没有结构时,如下
首页 简介 动态
选中文本按快捷键Ctrl+Shift+G,再弹出的:Enter Wrap Abbreviation(输入扩展缩写)中输入nav>ul>li.item$*>a
就会生成
<nav> <ul> <li class="item1"><a href="">首页</a></li> <li class="item2"><a href="">简介</a></li> <li class="item3"><a href="">动态</a></li> </ul> </nav>
如果原先的文本带编号,不想要则可以在上面的基础上加|t
,nav>ul>li.item$*>a|t
即可生成如上结果。
1首页 2简介 3动态
自动添加/更新图片尺寸:ctrl+U
光标移到标签上的任意位置,按下快捷键ctrl+U
即可。
<img src="img/x1.png" /> <img src="img/x1.png" width="100" height="200" />
删除标签:shift+ctrl+;
定位到上个编辑点:ctrl+alt+left
定位到下个编辑点:ctrl+alt+right
选中下一项:shift+ctrl+.
加/减1:ctrl+up/ctrl+down
加/减10:shift+alt+up/shift+alt+down
展开缩写:ctrl+e(和tab键作用相同)
重命名标签(rename_tag):ctrl+shift+'
更换标签(update_as_you_type):ctrl+Shift+U
匹配标签对:ctrl+alt+j
生成测试文本
输入lorem
再按tab会随机生成一段英文,默认是生成30个单词,可以加上数字控制单词数量,如lorem5
。
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis incidunt, expedita voluptates ratione praesentium error a accusamus corporis deleniti. Cum, debitis id, in rem exercitationem at voluptatum illum minima corporis!
Lorem ipsum dolor sit amet.
The above is the detailed content of Detailed explanation of the use of Sublime Text plug-in Emmet. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When Notepad files get too large, here are some solutions you can try: Use another text editor like Sublime Text as they don’t have file size limits. Split the file into smaller parts. Enable large file support via Registry Editor. Try using an alternative method such as Notepad++, WordPad, or Microsoft Word to open the file. Zip the file and open it with an archive tool.

There are three methods to achieve text column alignment in Notepad: 1. Use tabs; 2. Use spaces and adjust manually; 3. Use third-party tools (such as Notepad++, Sublime Text) to provide automatic alignment.

To open HTML files you need to use a browser such as Google Chrome or Mozilla Firefox. To open an HTML file using a browser, follow these steps: 1. Open your browser. 2. Drag and drop the HTML file into the browser window, or click the File menu and select Open.

IDLE and Jupyter Notebook are recommended for beginners, and PyCharm, Visual Studio Code and Sublime Text are recommended for intermediate/advanced students. Cloud IDEs Google Colab and Binder provide interactive Python environments. Other recommendations include Anaconda Navigator, Spyder, and Wing IDE. Selection criteria include skill level, project size and personal preference.

HTML can be used to open local files as follows: Create a .html file and import the jQuery library. Create an input field that allows the user to select a file. Listen to the file selection event and use a FileReader() object to read the file contents. Display the read file contents on the web page.

Steps to create a .py file in Python: Open a text editor (such as Notepad, TextMate, or Sublime Text). Create a new file and enter the Python code, paying attention to indentation and syntax. When saving the file, use a .py extension (for example, my_script.py).

Here are the steps to use copied code in Python: Copy and paste the code into a text editor. Create a Python file. Run the code from the command line. Understand what the code is for and how it works. Modify the code as needed and rerun it.

You can open HTML files on your phone by using your default browser and entering the file path or URL in the address bar. Using your file manager, navigate to the file location and click the HTML file. Download the text editor, navigate to the file location and double-click the HTML file. Download HTML Viewer from the App Store, navigate to the file location and tap on the HTML file.
