The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Emmet for ST2: html:5 abbreviation head

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #41938

    Is there a way to put things in the head element when using the
    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?

    Andy Howells

    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.


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


    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)
  • The forum ‘Other’ is closed to new topics and replies.