Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn on Auto Close Tags for HTML in PHPStorm

Tags:

phpstorm

I recently started a new project in PHPStorm, but noticed that none of my HTML elements are being auto closed like in my other projects.

If I type

<div>

the editor autoloads the

</div>

How do I turn this feature back on?

like image 233
Lloyd Banks Avatar asked Oct 12 '13 03:10

Lloyd Banks


People also ask

Does PhpStorm support HTML?

PhpStorm brings powerful support for HTML that includes syntax and error highlighting, formatting according to the code style, structure validation, code completion, on-the-fly preview during a debugging session (Live Edit) or in the dedicated preview tab in the code editor, and much more.

How do you make a closing tag in HTML?

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 /).

Does HTML5 have self-closing tags?

All tags in XML or XHTML can be used as self-closing by closing them with (<.. />). HTML5: Using a slash is absolutely optional. HTML4: Using a slash is technically invalid. However, the W3C's HTML validator still accepts it.

How do I close a php tag?

The closing tag of a block of PHP code automatically implies a semicolon; you do not need to have a semicolon terminating the last line of a PHP block. The closing tag for the block will include the immediately trailing newline if one is present. <?


1 Answers

File > Settings > Editor > Emmet > HTML

Under Filters Enabled By Default tick Comment Tags.

You'll then find if you use Emmet's syntax, for example:

.test#test TAB

It'll output:

<div class="test" id="test"></div>
<!-- /#test.test -->
like image 175
Daniel Dewhurst Avatar answered Oct 11 '22 05:10

Daniel Dewhurst