Sublime Forum

Auto-close <img> tags closes with </div>

#1

Hello everyone,

For some reason when I’m creating web pages and I create an image tag it auto closes with the closing tag instead of the closing tag.

Every other tag i believe seems to be working fine though.

What other details can I give you to help out with this? I’m using build 3065 of Sublime Text 3

0 Likes

#2

Typing “img” and hitting tab expands to the right <img … /> tag on both win (7 pro), linux (ubuntu 14.04) and osX (mountain lion) for me…
So, assuming that you are typing “</” to trigger the autoclosing tags, then it’s true that the autoclose behave in a strange way, actually trying to close the tag containing the
BUT
please note that img tag is self-closing so it should be <img … > (<img … /> if you are writing xhtml) and not <img …>…
In this case sublime is just trying to do what you want closing the very first open tag it finds at caret position… :wink:

0 Likes