個性化Markdown

markedstyle
擴(kuò)展Markdown支持自定義樣式屬性
MarkDown CSS樣式
修改Markdown的渲染樣式
用Markdown來寫自由書籍-開源技術(shù)的方案
美化Markdown輸出的HTML文檔

修改CSS樣式自定義PDF輸出:

/* RESET
=============================================================================*/

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
}

/* BODY
=============================================================================*/

body {
  font-family: Helvetica, arial, freesans, clean, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #34495e;
  background-color: #fff;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

body>*:first-child {
  margin-top: 0 !important;
}

body>*:last-child {
  margin-bottom: 0 !important;
}

/* BLOCKS
=============================================================================*/

p, ul, ol, dl, table, pre {
  margin: 15px 0;
}

/* HEADERS
=============================================================================*/

h1, h2, h3, h4, h5, h6 {
  margin: 20px 0 10px;
  padding: 0;
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
  color: #2c3e50;
}

h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
  font-size: inherit;
}

h1 {
    font-size: 28px;
    margin: 45px 0 0.8em;
    padding-bottom: 0.7em;
    border-bottom: 1px solid #ddd;
    z-index: -1;
}

h2 {
    font-size: 24px;
    border-bottom: 1px solid #ccc;
}

h3 {
    font-size: 18px;
    margin: 45px 0 0.8em;
    padding-bottom: 0.7em;
    border-bottom: 1px solid #ddd;
    z-index: -1;
}

h4 {
    font-size: 16px;
    margin: 45px 0 0.8em;
    padding-bottom: 0.7em;
    border-bottom: 1px solid #ddd;
    z-index: -1;
}

h5 {
    font-size: 14px;
    margin: 45px 0 0.8em;
    padding-bottom: 0.7em;
    border-bottom: 1px solid #ddd;
    z-index: -1;
}

h6 {
    font-size: 13px;
    margin: 45px 0 0.8em;
    padding-bottom: 0.7em;
    border-bottom: 1px solid #ddd;
    z-index: -1;
}

h1:before {
    content: "# ";
    color: #32A03C;
    font-size: 28px;
}

h2:before {
    content: "# ";
    color: #32A03C;
    font-size: 24px;
}

h3:before {
    content: "# ";
    color: #32A03C;
    font-size: 18px;
}

h4:before {
    content: "# ";
    color: #32A03C;
    font-size: 16px;
}

h5:before {
    content: "# ";
    color: #32A03C;
    font-size: 14px;
}

h6:before {
    content: "# ";
    color: #32A03C;
    font-size: 14px;
}

body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {
  margin-top: 0;
  padding-top: 0;
}

a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
  margin-top: 0;
  padding-top: 0;
}

h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {
  margin-top: 10px;
}

/* LINKS
=============================================================================*/

a {
  color: #60A04E;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* LISTS
=============================================================================*/

ul, ol {
  padding-left: 30px;
}

ul li > :first-child, 
ol li > :first-child, 
ul li ul:first-of-type, 
ol li ol:first-of-type, 
ul li ol:first-of-type, 
ol li ul:first-of-type {
  margin-top: 0px;
}

ul ul, ul ol, ol ol, ol ul {
  margin-bottom: 0;
}

dl {
  padding: 0;
}

dl dt {
  font-size: 14px;
  font-weight: bold;
  font-style: italic;
  padding: 0;
  margin: 15px 0 5px;
}

dl dt:first-child {
  padding: 0;
}

dl dt>:first-child {
  margin-top: 0px;
}

dl dt>:last-child {
  margin-bottom: 0px;
}

dl dd {
  margin: 0 0 15px;
  padding: 0 15px;
}

dl dd>:first-child {
  margin-top: 0px;
}

dl dd>:last-child {
  margin-bottom: 0px;
}

/* CODE
=============================================================================*/

pre, code, tt {
  font-size: 12px;
  font-family: Consolas, "Liberation Mono", Courier, monospace;
}

code, tt {
    color: #e96900;
    /*color: #D9534F;*/
    padding: 3px 5px;
    margin: 0 2px;
    border-radius: 2px;
    white-space: normal;
    background-color: #f8f8f8;
}

pre>code {
    line-height: 2;
    font-family: consolas,Menlo,PingFang SC,Microsoft YaHei,monospace;
    font-size: 25px;
    background-color: #f8f8f8;
    -webkit-font-smoothing: initial;
}

pre {
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    font-size: 13px;
    line-height: 19px;
    overflow: auto;
    padding: 6px 10px;
    border-radius: 3px;
}

pre code, pre tt {
    background-color: transparent;
    border: none;
}

kbd {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #DDDDDD;
    background-image: linear-gradient(#F1F1F1, #DDDDDD);
    background-repeat: repeat-x;
    border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD;
    border-image: none;
    border-radius: 2px 2px 2px 2px;
    border-style: solid;
    border-width: 1px;
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
    line-height: 10px;
    padding: 1px 4px;
}

/* QUOTES
=============================================================================*/

blockquote {
    display: block;
    -webkit-margin-before: 1em;
    -webkit-margin-after: 1em;
    -webkit-margin-start: 40px;
    -webkit-margin-end: 40px;
    margin: 2em 0;
    padding-left: 20px;
    border-left: 4px solid #42b983;
}

blockquote>:first-child {
  margin-top: 0px;
}

blockquote>:last-child {
  margin-bottom: 0px;
}

/* HORIZONTAL RULES
=============================================================================*/

hr {
  clear: both;
  margin: 15px 0;
  height: 0px;
  overflow: hidden;
  border: none;
  background: transparent;
  border-bottom: 4px solid #ddd;
  padding: 0;
}

/* TABLES
=============================================================================*/

table th {
  font-weight: bold;
}

table th, table td {
  border: 1px solid #ccc;
  padding: 6px 13px;
}

table tr {
  border-top: 1px solid #ccc;
  background-color: #fff;
}

table tr:nth-child(2n) {
  background-color: #f8f8f8;
}

/* IMAGES
=============================================================================*/

img {
  max-width: 100%
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末诞丽,一起剝皮案震驚了整個濱河市弹囚,隨后出現(xiàn)的幾起案子子漩,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 221,695評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件轿腺,死亡現(xiàn)場離奇詭異锦聊,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)享甸,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,569評論 3 399
  • 文/潘曉璐 我一進(jìn)店門截碴,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人蛉威,你說我怎么就攤上這事日丹。” “怎么了蚯嫌?”我有些...
    開封第一講書人閱讀 168,130評論 0 360
  • 文/不壞的土叔 我叫張陵哲虾,是天一觀的道長。 經(jīng)常有香客問我择示,道長束凑,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,648評論 1 297
  • 正文 為了忘掉前任栅盲,我火速辦了婚禮汪诉,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘谈秫。我一直安慰自己扒寄,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,655評論 6 397
  • 文/花漫 我一把揭開白布拟烫。 她就那樣靜靜地躺著该编,像睡著了一般。 火紅的嫁衣襯著肌膚如雪硕淑。 梳的紋絲不亂的頭發(fā)上课竣,一...
    開封第一講書人閱讀 52,268評論 1 309
  • 那天,我揣著相機(jī)與錄音喜颁,去河邊找鬼稠氮。 笑死,一個胖子當(dāng)著我的面吹牛半开,可吹牛的內(nèi)容都是我干的隔披。 我是一名探鬼主播,決...
    沈念sama閱讀 40,835評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼寂拆,長吁一口氣:“原來是場噩夢啊……” “哼奢米!你這毒婦竟也來了抓韩?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,740評論 0 276
  • 序言:老撾萬榮一對情侶失蹤鬓长,失蹤者是張志新(化名)和其女友劉穎谒拴,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體涉波,經(jīng)...
    沈念sama閱讀 46,286評論 1 318
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡英上,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,375評論 3 340
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了啤覆。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片苍日。...
    茶點(diǎn)故事閱讀 40,505評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖窗声,靈堂內(nèi)的尸體忽然破棺而出相恃,到底是詐尸還是另有隱情,我是刑警寧澤笨觅,帶...
    沈念sama閱讀 36,185評論 5 350
  • 正文 年R本政府宣布拦耐,位于F島的核電站,受9級特大地震影響见剩,放射性物質(zhì)發(fā)生泄漏杀糯。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,873評論 3 333
  • 文/蒙蒙 一炮温、第九天 我趴在偏房一處隱蔽的房頂上張望火脉。 院中可真熱鬧,春花似錦柒啤、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,357評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至没炒,卻和暖如春涛癌,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背送火。 一陣腳步聲響...
    開封第一講書人閱讀 33,466評論 1 272
  • 我被黑心中介騙來泰國打工拳话, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人种吸。 一個月前我還...
    沈念sama閱讀 48,921評論 3 376
  • 正文 我出身青樓弃衍,卻偏偏與公主長得像,于是被迫代替她去往敵國和親坚俗。 傳聞我的和親對象是個殘疾皇子镜盯,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,515評論 2 359

推薦閱讀更多精彩內(nèi)容