分享一个Markdown css

Yisen 发布于 2012/10/26 11:34
阅读 15K+
收藏 4
@charset "utf-8";

html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }

body{
    color:#444;
    font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif;
    font-size:13px;
    line-height:1.5em;
    padding:1em;
    margin:auto;
    max-width:42em;
    background:#fefefe;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
}

h1 {
    color: #000000;
    font-size: 28px;
}

h2 {
    border-bottom: 2px solid #CCCCCC;
    color: #000000;
    font-size: 24px;
}

h3 {
    border-bottom: 2px solid #CCCCCC;
    font-size: 18px;
}

h4 {
    font-size: 16px;
}

h5 {
    font-size: 14px;
}

h6 {
    color: #777777;
    background-color: inherit;
    font-size: 14px;
}

hr {
    height: 0.2em;
    border: 0;
    color: #CCCCCC;
    background-color: #CCCCCC;
}

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

p{
    margin:1em 0;
}

pre { 
    background-color: #F8F8F8;    
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    overflow: auto;
    padding: 5px;
}

pre code {
    background-color: #F8F8F8;
    border: none;    
    padding: 0;
}

code {
    font-family: Consolas, Monaco, Andale Mono, monospace;
    background-color:#F8F8F8;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    padding: 0 0.2em;
    line-height: 1;
}

pre > code {
    border: 0;
    margin: 0;
    padding: 0;
}


a{ color: #0645ad; text-decoration:none;}
a:visited{ color: #0b0080; }
a:hover{ color: #06e; }
a:active{ color:#faa700; }
a:focus{ outline: thin dotted; }
a:hover, a:active{ outline: 0; }

::-moz-selection{background:rgba(255,255,0,0.3);color:#000}
::selection{background:rgba(255,255,0,0.3);color:#000}

a::-moz-selection{background:rgba(255,255,0,0.3);color:#0645ad}
a::selection{background:rgba(255,255,0,0.3);color:#0645ad}

blockquote{
    color:#666666;
    margin:0;
    padding-left: 3em;
    border-left: 0.5em #EEE solid;
}

ul, ol { margin: 1em 0; padding: 0 0 0 2em; }
li p:last-child { margin:0 }
dd { margin: 0 0 0 2em; }

img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; max-width:100%;}

table { border-collapse: collapse; border-spacing: 0; }
td { vertical-align: top; }

@media only screen and (min-width: 480px) {
    body{font-size:14px;}
}

@media only screen and (min-width: 768px) {
    body{font-size:16px;}
} 

预览

H2,H3自带了分割线,可自行修改

H1

H2

H3

H4

H5
H6

OSChina

引用

二级引用

代码
print "Hello world" 

文档中print()

粗体

  • test1
  • test2
    • test3

斜体

  1. test1
  2. test2
    1. test3

加载中
0
帆船
帆船

谢了,这个很清爽。

0
0
Izhu
Izhu
请问下,这个markdown css如何引用到markdown文件内
Yisen
Yisen
各编辑器应该有js样式的编辑,你可以看看
0
o
osos
太赞了!
0
返回顶部
顶部