If I type .myClass and press tab emmet expands this how it should... but if I type .myClass class2 it does not expand because there is a space. How can I add two classes to a div with emmet?
You can place as many attributes as you like inside square brackets. You don't have to specify attribute values: td[colspan title] will produce <td colspan="" title=""> with tabstops inside each empty attribute (if your editor supports them). You can use single or double quotes for quoting attribute values.
The attribute, if specified, must have a value that is a set of space-separated tokens representing the various classes that the element belongs to. So when the HTML is parsed, any class name that includes a space would end up being parsed as two different classes.
Emmet uses a specific syntax in order to expand small snippets of code, similar to CSS selectors, into full-fledged HTML code. For example, the sequence. div#page>div.logo+ul#navigation>li*5>a. or. #page>.logo+ul#navigation>li*5>a.
Instead of using a space, use a dot.
http://www.sitepoint.com/faster-workflow-mastering-emmet-part-3/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With