强调
将文本设置为粗体或斜体来强调文本
粗体
要加粗粗体,要在单词或短语的前后各添加两个星号**或下划线__。
如果需要加粗一个单词或短语的中间部分表示强调的话,在要加粗的部分两侧添加两个星号**或下划线__。
| Markdown 语法 | HTML 语法 | 渲染效果 |
|---|---|---|
**This is bold text** | <p><strong>This is bold text</strong></p> | This is bold text |
__This is bold text__ | <p><strong>This is bold text</strong></p> | This is bold text |
This is **bold** text | <p>This is <strong>bold</strong> text</p> | This is bold text |
粗体的最佳实践
不同的Markdown应用程序在处理下划线的情况并不一致。建议优先使用**来加粗文本。
| ✅Do this | ❌Don't do this |
|---|---|
This is **bold** text | This is __bold__ text |
斜体
要使文本变为斜体,要在单词或短语的前后各添加一个星号*或下划线_。
如果需要斜体一个单词或短语的中间部分表示强调的话,在要斜体部分两侧添加一个星号*或下划线_。
| Markdown 语法 | HTML 语法 | 渲染效果 |
|---|---|---|
*This is italic text* | <p><em>This is italic text</em></p> | This is italic text |
_This is italic text_ | <p><em>This is italic text</em></p> | This is italic text |
This is *italic* text | <p>This is <em>italic</em> text</p> | This is italic text |
斜体的最佳实践
不同的Markdown应用程序在处理下划线的情况并不一致。建议优先使用*来斜体文本。
| ✅Do this | ❌Don't do this |
|---|---|
This is *italic* text | This is _italic_ text |
粗斜体
要同时加粗和斜体一个单词或短语,可以在单词或短语的前后各添加三个星号***或下划线___。
| Markdown 语法 | HTML 语法 | 渲染效果 |
|---|---|---|
***This is bold italic text*** | <p><strong><em>This is bold italic text</em></strong></p> | This is bold italic text |
___This is bold italic text___ | <p><strong><em>This is bold italic text</em></strong></p> | This is bold italic text |
This is ***bold italic*** text | <p>This is <strong><em>bold italic</em></strong> text</p> | This is bold italic text |
粗斜体的最佳实践
不同的Markdown应用程序在处理下划线的情况并不一致。建议优先使用***来加粗斜体文本。
| ✅Do this | ❌Don't do this |
|---|---|
This is ***bold italic*** text | This is ___bold italic___ text |