Search code examples
phpstormwebstormjetbrains-ide

Is there any way to quickly add class to an HTML element in JetBrains IDEs?


I am trying PhpStorm and I coming over from VS Code.

I am used to adding classes and ids to my html elements like this: element.class or element#id. I got very used to it and now I very much miss it.

Is there any similar way to add classes and ids to html elements in PhpStorm?


Solution

  • It's called Emmet and it is supported in JetBrains IDEs (IDEA based at least).

    Just press Tab (default shortcut, can be changed in Settings/Preferences | Editor | Emmet) to expand the sequence, e.g. p.red[TAB] to make <p class="red">[CARET]</p>

    https://www.jetbrains.com/help/phpstorm/using-zen-coding-support.html