Topic 3C: Emmet: CSS Abbreviations
Master CSS abbreviations for lightning-fast coding productivity
Emmet's CSS abbreviations can reduce the time spent typing repetitive CSS properties by expanding short codes into full declarations with a simple Tab press.
How to Use Emmet CSS Abbreviations
Type the abbreviation
Enter the short code based on property names or first letters
Press Tab
The abbreviation expands into full CSS code automatically
Fill in values
Use Tab to jump between placeholder values and customize them
When specifying units like percentages, do not include hyphens as separators. Hyphens would create negative values instead.
After expanding abbreviations with multiple values like RGB colors or box-shadow properties, use Tab to jump between different value placeholders for efficient editing.
How to Use Emmet CSS Abbreviations
Type the abbreviation
Enter the short code based on property names or first letters
Press Tab
The abbreviation expands into full CSS code automatically
Fill in values
Use Tab to jump between placeholder values and customize them
When no unit is specified in Emmet abbreviations, pixels (px) are automatically assumed as the default unit.
When specifying units like percentages, do not include hyphens as separators. Hyphens would create negative values instead.
Common CSS Property Abbreviations
Spacing Properties
Padding and margin shortcuts like 'p' for padding and 'm' for margin. Add directional suffixes like 't' for top.
Text Properties
Text alignment and display properties such as 'tac' for text-align center and 'dib' for display inline-block.
When no unit is specified in Emmet abbreviations, pixels (px) are automatically assumed as the default unit.
When specifying units like percentages, do not include hyphens as separators. Hyphens would create negative values instead.
When no unit is specified in Emmet abbreviations, pixels (px) are automatically assumed as the default unit.
When specifying units like percentages, do not include hyphens as separators. Hyphens would create negative values instead.
Unit Types in Emmet
| Feature | With Unit | Without Unit |
|---|---|---|
| Margin 20 | m20p = margin: 20% | m20 = margin: 20px |
| Font Size 2 | fz2e = font-size: 2em | fz2 = font-size: 2px |
How to Use Emmet CSS Abbreviations
Type the abbreviation
Enter the short code based on property names or first letters
Press Tab
The abbreviation expands into full CSS code automatically
Fill in values
Use Tab to jump between placeholder values and customize them
Color and Visual Properties
Background & Border
Quick shortcuts for styling elements with 'bg' for background and 'bd' for border properties.
Color Variations
Multiple color formats available including basic color, RGB, and RGBA with different levels of control.
Color and Visual Properties
Background & Border
Quick shortcuts for styling elements with 'bg' for background and 'bd' for border properties.
Color Variations
Multiple color formats available including basic color, RGB, and RGBA with different levels of control.
Color and Visual Properties
Background & Border
Quick shortcuts for styling elements with 'bg' for background and 'bd' for border properties.
Color Variations
Multiple color formats available including basic color, RGB, and RGBA with different levels of control.
After expanding abbreviations with multiple values like RGB colors or box-shadow properties, use Tab to jump between different value placeholders for efficient editing.
Emmet CSS Mastery Checklist
Focus on frequently used properties like margin, padding, and display
Learn when to use hyphens vs unit letters for different value types
Use Tab to efficiently move between and edit multiple values
Keep docs.Emmet.io/cheat-sheet bookmarked for comprehensive abbreviation lists
Both sets of values will be highlighted so you only have to type them once
Key Takeaways