6

I try to comment out a block of HTML which contains comments, when the time I do so, the commenting terminated at the first comment tag ending. Is there any way to do so? I didn't find it anywhere.

Let see this HTML

<!-- START overview-section -->
<div class="overview gray"> 
    <!-- Title section -->
    <div class="row">
    </div>
</div>

How to comment it as a whole.

Uğur Aldanmaz
  • 1,018
  • 1
  • 11
  • 16
Sobin Augustine
  • 3,639
  • 2
  • 25
  • 43

3 Answers3

3

Short of breaking up the pairs of -- inside the comment, you cannot achieve this in HTML.

If you were generating your HTML from some kind of template language, you could use the template language's comment syntax instead.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
3

You can wrap it up in a script tag and use JavaScript's block comments

<script> /***
<!-- START overview-section -->
<div class="overview gray"> 
    <!-- Title section -->
    <div class="row">
    </div>
</div>
***/ </script>
Bakr
  • 117
  • 8
1

this can't be done with HTML. It can however be done if it were php

<?php 
//<!-- START overview-section -->
//<div class="overview gray"> 
//    <!-- Title section -->
//    <div class="row">
//    </div>
//</div>
?>