主要使用的是 html5
的 details
標籤html5
(1)示例以下:git
<details> <summary>摺疊文本</summary> 此處可書寫文本 嗯,是能夠書寫文本的 </details> <details> <summary>摺疊代碼塊</summary> <pre><code> System.out.println("雖然能夠摺疊代碼塊"); System.out.println("可是代碼沒法高亮"); </code></pre> </details> <details> <summary>摺疊代碼塊</summary> <pre><blockcode> System.out.println("雖然能夠摺疊代碼塊"); System.out.println("可是代碼沒法高亮"); </blockcode></pre> </details>
(2)效果以下:github
System.out.println("雖然能夠摺疊代碼塊"); System.out.println("可是代碼沒法高亮");
(3)解讀code
details
:摺疊語法標籤summary
:摺疊語法展現的摘要pre
:以原有格式顯示元素內的文字是已經格式化的文本code
:指定代碼塊