shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.48k stars 173 forks source link

[BUG] center title #2008

Open BrentHuang opened 5 months ago

BrentHuang commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

### 三级标题居中示例 {#三级标题居中示例 data-source-line="151"}

Environment

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

三级标题居中示例

Markdown file Please attach the markdown file that can reproduce the bug. a.md

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here.

BrentHuang commented 5 months ago
<center>**加粗的文字,并且水平居中**</center>
<center><u>加下划线的文字,并且水平居中</u></center>
<center>==标记的文字,并且水平居中==</center>
Yue-Zhengyuan commented 5 months ago

You can center align the title by changing the CSS. Add the following lines to your style.less file:

h1, h2, h3, h4, h5, h6 {
    text-align: center;
}

Don't use the HTML <center> tag.