通常,在使用html編碼視圖模板時,添加一些有用註釋的習慣在測試時會耗費大量時間。如何在HTML代碼中評論/取消註釋
考慮以下代碼...
<!-- Here starts the sidebar -->
<div id="sidebar">
....
</div>
<!-- Here starts the main contents pane -->
<div id="main-contents">
...
</div>
<!-- Here starts the footer -->
<div id="footer">
...
</div>
現在,如果我不得不躲藏在PHP的情況下,視圖模板的某些部分,我只是選擇所需的代碼,並把單行註釋(大部分時間使用快捷鍵)。
但是,在只有塊註釋工作的html代碼中,我最終刪除了所有結束註釋標記( - >),直到我想要發生註釋的位置 - 像這樣的事情......
<!-- Here starts the sidebar
<div id="sidebar">
....
</div>
<!-- Here starts the main contents pane
<div id="main-contents">
...
</div>
<!-- Here starts the footer
<div id="footer">
...
</div>-->
然後當我完成測試後,我必須經歷這些結束標記的痛苦。
在HTML中是否有更好更省時的方式進行塊評論?
這是行不通的,因爲任何' - >'之間都會結束註釋,這不是他想要的。他希望能夠輕鬆地註釋出一個塊,*不必手動刪除其中的所有' - >',然後在最後重新添加它們。 – 2010-09-21 04:11:26