入门指南
语法速查表
基本语法
标题语法
段落语法
换行语法
强调语法
引用语法
列表语法
代码语法
分隔线语法
链接语法
图片语法
转义字符语法
内嵌 HTML 标签
扩展语法
扩展语法可用性
表格
围栏代码块
脚注
标题编号
定义列表
删除线
任务列表语法
使用 Emoji 表情
Highlight
Subscript
自动网址链接
禁止自动将 URL 转换为链接
Hacks
Underline
Indent (Tab)
Center
Color
Comments
Admonitions
Image Size
Image Captions
Link Targets
Symbols
Table Formatting
Table of Contents
Videos
书写工具
Center - markdown入门指南 - 笔下光年
网站首页
Center
Having the ability to center text is a necessity when writing a paper or a report. Unfortunately, Markdown doesn’t have any concept of text alignment (one possible exception is when using <a href="http://www.bixiaguangnian.com/manual/markdown/4115.html">tables</a>). The good news is that there’s an HTML tag you can use: <code><center></code>. If your Markdown processor supports <a href="http://www.bixiaguangnian.com/manual/markdown/4111.html">HTML</a>, you can place these tags around whatever text you want to center align. ```markdown <center>This text is centered.</center> ``` The rendered output looks like this: <center>This text is centered.</center> The <code class="language-plaintext highlighter-rouge"><center></code> HTML tag is technically supported but officially <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center">deprecated</a>, which means it works for now but you’re not supposed to be using it. Unfortunately, there’s not another pure HTML alternative. You could try using one of the CSS alternatives. Not all Markdown applications provide CSS support, but if the one you’re using does, here’s an alternative to the <code><center></code> tag: ```markdown <p style=“text-align:center”>Center this text</p> ``` If this is supported by your Markdown application, the output looks like this: <p style=“text-align:center”>Center this text</p>
上一篇:
Indent (Tab)
下一篇:
Color