如何使用Markdown在GitHub README中渲染多个列? [英] How to render multiple columns with Markdown in GitHub README?
问题描述
要在三列中呈现项目,我尝试将以下CSS3指令添加到我的项目的 README.md
文件,但样式被删除:
To render items in three columns, I attempted to add the following CSS3 directives to my project's README.md
file, but the styling was stripped out:
<div style="-webkit-column-count: 3; -moz-column-count: 3; column-count: 3; -webkit-column-rule: 1px dotted #e0e0e0; -moz-column-rule: 1px dotted #e0e0e0; column-rule: 1px dotted #e0e0e0;">
<div style="display: inline-block;">
<!-- first column's content -->
</div>
<div style="display: inline-block;">
<!-- second column's content -->
</div>
<div style="display: inline-block;">
<!-- third column's content -->
</div>
</div>
这种样式在GitHub处理Markdown之外可以正常工作。如何将数据放入Markdown文档中的多个列?注意,我不关心IE浏览器的支持,不在乎IE是否渲染单个列(我的软件项目不能在Windows客户端上工作。)
This styling works correctly outside of GitHub's processing of Markdown. How can I put data into multiple columns in a Markdown document? Note that I am not concerned about support for IE browsers and don't care if IE renders a single column (my software project does not work on Windows clients, anyway).
推荐答案
GitHub-Flavored Markdown 只允许某些在内嵌HTML 中列入白名单的标签和属性:
GitHub-Flavored Markdown only permits certain whitelisted tags and attributes in inline HTML:
HTML
您可以在README,问题和pull请求中使用HTML的一个子集。
HTML
You can use a subset of HTML within your READMEs, issues, and pull requests.
我们支持的标记和属性的完整列表可以在 github / markup的自述文件。
A full list of our supported tags and attributes can be found in the README for github/markup.
关于< div>
标签,README说只有 itemscope
除了一般属性白名单之外, itemtype
属性已列入白名单:
Regarding <div>
tags, that README says that only the itemscope
and itemtype
attributes are whitelisted, in addition to the general attribute whitelist:
code> abbr ,
accept
,accept-charset
,accesskey
,action
,align
,alt
,
axis
,border
,cellpadding
,cellspacing
,char
,charoff
,,
,
,
,
code>,
cols
,colspan
,,
compact
,coords
,datetime
,dir
,disabled
,enctype
code>,,,
,
,
hreflang
,hspace
,ismap
,label
,lang
,longdesc
,maxlength
,
,
,
,
,
name
,nohref
,noshade
,nowrap
,提示
,readonly
,rel
,
rev
,rows
,rowspan
,,
,
,
c> shape
,size
,span
,code>,
,
,tabindex
,title
,type
,usemap
,valign
,value
,vspace
,code>,
itemprop
abbr
,accept
,accept-charset
,accesskey
,action
,align
,alt
,axis
,border
,cellpadding
,cellspacing
,char
,charoff
,charset
,checked
,cite
,clear
,cols
,colspan
,color
,compact
,coords
,datetime
,dir
,disabled
,enctype
,for
,frame
,headers
,height
,hreflang
,hspace
,ismap
,label
,lang
,longdesc
,maxlength
,media
,method
,multiple
,name
,nohref
,noshade
,nowrap
,prompt
,readonly
,rel
,rev
,rows
,rowspan
,rules
,scope
,selected
,shape
,size
,span
,start
,summary
,tabindex
,target
,title
,type
,usemap
,valign
,value
,vspace
,width
,itemprop
没有标签支持 style
属性。
除非你能够与自述文件中列出的标签和属性一起添加一些东西,否则你会发现
Unless you can hack something together with the tags and attributes listed in that README I think you'll find that you're out of luck.
另一种方法是将 GitHub Pages 网站,这似乎更灵活。
An alternative would be to put together a GitHub Pages site, which seems to be much more flexible.
这篇关于如何使用Markdown在GitHub README中渲染多个列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!