Home>Article>Web Front-end> Unknown Emmet Grammar Rules
This article will give you a detailed introduction to the grammatical rules of HTML shorthand Emmet. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
In the process of front-end development, the most time-consuming work is writing HTML and CSS code. A bunch of tags, attributes, brackets, etc., which is a headache. Here is an Emmet grammar rule recommended, which will make you feel super happy when writing. It can greatly improve your code writing. You only need to type one line of code to generate the complete HTML structure you want. The following will introduce how to use it.
Emmet is a plug-in that can be used by any editor that can install it. Most editors can use this grammar rule. We usually develop Sublime Text, Eclipse, Notepad, VS code, Atom, Dreamweaver and other editors can be used.
The installation method is the same as usual installation of plug-ins. Search for this emmet plug-in installation. Each editor has different installation methods. Please try each one.
1: html initial structure
With the structure in the picture below, anyone who is lazy will just follow it! => Tab solution, which can quickly generate the basic structure and prevent forgetting a certain code block and entering wrong code when writing by hand.
2: id(#),class(.)
id command:#; class command:.
3: Child node (>), sibling node ( ), superior Node (^)
Child node command:> ; Sibling node command: ; Superior node:^
4: Repeat (*)
Repeat command: *
5: Grouping (())
Grouping instructions: ()
Explanation: If there are no parentheses here, guess, a p and p are brothers to a, and will be included in li. Got it, hahahaha
6: Attribute ([attr]) - id, class, how can I miss the attribute?
Attribute command: []
6: Number ($)
For example: ul>.test$*3
Recommended learning:html video tutorial
###The above is the detailed content of Unknown Emmet Grammar Rules. For more information, please follow other related articles on the PHP Chinese website!