Smarter Closing of Tags

Hello Friends

Whenever I code HTML I follow the following technique when it comes to closing my HTML div tags.

<div id="pageContainer">
     <div >
          // content goes here
     </div><!-- .logoWrap -->
</div><!-- #pageContainer -->

This way I can easily identify which start div a partciular end div belongs to, this is handy for when you can't see the start and end of divs on the screen (i.e. you have to scroll).

Is there a way I can make my WebStorm do this automatically for divs? I am on the latest version of WebStorm.

I currently do this manually, and find it to be very time consuming :(

Any help would be greatly appreciated.

Thank You all.

C.

1 comment
Comment actions Permalink

Hi,

No -- you cannot make IDE to insert such closing comments automatically.

1) HTML Breadcrumbs (the bar on top of editor) should help you here to some degree as they show what the current tag is (and what id/class)
2) You can use Live Templates (Settings | Live Templates) to speed up generating such comments or whole div tag

0

Please sign in to leave a comment.