Grow your CSS skills. Land your dream job.

Emmet for ST2: html:5 abbreviation head

  • # January 11, 2013 at 1:57 pm

    Is there a way to put things in the head element when using the
    html:5
    abbreviation? putting things into the body is as easy as html:5>(insert body markup), how do I put stuff into the head, like links to stylesheets and scripts within that same expression?

    # January 11, 2013 at 2:24 pm

    Hmm. I tried a few variations but couldn’t come up with one myself.

    What you could do is create your own snippet within Sublime’s standard snippets functionality. So you could do your own custom shortcut, like html5x for example.

    # January 11, 2013 at 2:28 pm

    I think I’ll going to set it to html:5(head elements)>(body elements), if I can figure out how.

    # January 11, 2013 at 10:19 pm

    I edited Emmet.sublime-settings snippets as shown here.

    So now I can add a document title, stylesheet, and script within the expression as follows:


    html:5[title="My Webpage"][style=mystylesheet.css][script=myscript.js]

    While adding this functionality, I discovered that I can use “!” instead of “html:5″, so it also works like this:


    ![title="My Webpage"][style=mystylesheet.css][script=myscript.js]

    Hopefully this will be of use to others.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".