Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Short cut for close HTML tag in Sublime Text 2

Is there a shortcut to close the HTML tag you've just opened in sublime text 2?

like image 266
Rich Avatar asked Aug 08 '13 23:08

Rich


People also ask

How do I automatically close a tag in Sublime Text?

But there should be some built into sublime. For example, as you start to type <div> , you should see a drop down box with matching snippets. Hit Tab or Enter to pick one and arrow keys to go up or down in the list. For html tags, it will automatically adds the closing tag and puts the cursor in between them.

How do I close HTML tags?

An opening tag begins a section of page content, and a closing tag ends it. For example, to markup a section of text as a paragraph, you would open the paragraph with an opening paragraph tag <p> and close it with a closing paragraph tag </p> (closing tags always proceed the element with a /).

What is the closing tag for the body section in HTML?

On any normal-sized HTML document, you'll usually see the opening tag ( <body> ) near the top of the document and the closing tag ( </body> ) near the bottom. There can only be one <body> element per HTML document.

What is tag closure?

Why is closing a FASTag account important when you sell the car? In case you have sold or transferred your vehicle, you should get the FASTag deactivated/closed immediately as the Toll payment will continue to be deducted from the source account to which the FASTag is linked.


2 Answers

I just found out pressing

For Mac: Alt + Command + .

For PC: Alt + .

For Linux: Alt + .

will finish the tag you currently have open.

E.g. you type

<div> 

Pressing the shortcut will give you

</div> 
like image 58
Rich Avatar answered Sep 22 '22 04:09

Rich


You can just type the type of tag you would like to insert and press tab!

Examples:

  • Type div then press Tab to get <div></div> with the cursor in the tag's content, and tab again to exit the tag.
  • Type a then press Tab to get <a href=""></a> with the cursor in the quotes, tab again to move to the tag's content, and tab again to exit the tag
like image 33
chili434 Avatar answered Sep 19 '22 04:09

chili434