<!-- 這是單行註釋 -->
<!--
這是多行註釋
可以跨越多行
不會在瀏覽器顯示
-->
<!-- <!-- 內層 --> 外層 --> 會在內層結束處提前閉合。--:註釋內容中不能出現連續兩個連字符,否則解析錯誤。<title>、<style>、<script> 內使用:這些標籤內容有獨立解析規則。<!--[if IE]>
<link rel="stylesheet" href="ie-fix.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="modern.css">
<!--<![endif]-->
現代項目請使用特性檢測、Polyfill 或 @supports 替代。
<!--
@file header.html
@author Team UI
@date 2024-01-15
@desc 全站公共頁首組件
-->
<!-- === Header 開始 === -->
<header>...</header>
<!-- === Header 結束 === -->
<!-- 此處使用 flex 布局,IE10 需加 -ms- 前綴,由 Autoprefixer 自動處理 -->
<div class="flex-container">...</div>
<!-- TODO: 接入用戶頭像上傳 API -->
<!-- FIXME: Safari 下 flex-wrap 行高異常 -->
html-minifier 或 html-webpack-plugin 選項 removeComments: true 自動剔除註釋,減小體積。良好的註釋習慣能顯著降低維護成本。遵循「解釋為什麼,而非做什麼」原則,配合工具自動清理,讓代碼既整潔又自文檔化。