I an emacs newbie and I generally write a lot html code(~800 lines in one file). Now I want to a compact view to the completed tags. An example of this would be:

 <div class="col-md-4 col-sm-6">
   <div class="text-left">
     <div id="canvas-holder">
        <canvas id="chart-area3">
     <p class="text-center">Bachelor of Science</p>
 </div><!-- End of col-md-4 col-sm-6 chart3 div -->

This code appears like this:

[+]<div class="col-md-4 col-sm-6">...</div><!-- End of col-md-4 col-sm-6 chart3 div -->

Well not exactly same but you get the idea. How can I achieve this? Please also give some details of the key-bindings associated as well/

  • 4
    The old “how to fold XML” question: emacs.stackexchange.com/a/3157/2287
    – lawlist
    Jun 5, 2015 at 6:17
  • @lawlist This works well for me. However how can I use this in html-mode using the same binding "C-c h"?
    – xandfury
    Jun 5, 2015 at 7:09


Browse other questions tagged or ask your own question.