樣式一
/* * NOTE: * - The use of browser-specific styles (-moz-, -webkit-) should be avoided. * If used, they may not render correctly for people reading the email in * a different browser than the one from which the email was sent. * - The use of state-dependent styles (like a:hover) don't work because they * don't match at the time the styles are made explicit. (In email, styles * must be explicitly applied to all elements -- stylesheets get stripped.) */ /* This is the overall wrapper, it should be treated as the `body` section. */ .markdown-here-wrapper { } /* To add site specific rules, you can use the `data-md-url` attribute that we add to the wrapper element. Note that rules like this are used depending on the URL you're *sending* from, not the URL where the recipient views it. */ /* .markdown-here-wrapper[data-md-url*="mail.yahoo."] ul { color: red; } */ pre, code { font-size: 0.85em; font-family: Consolas, Inconsolata, Courier, monospace; } code { margin: 0 0.15em; padding: 0 0.3em; white-space: pre-wrap; border: 1px solid #EAEAEA; background-color: #F8F8F8; border-radius: 3px; display: inline; /* added to fix Yahoo block display of inline code */ } pre { font-size: 1em; line-height: 1.2em; } pre code { white-space: pre; overflow: auto; /* fixes issue #70: Firefox/Thunderbird: Code blocks with horizontal scroll would have bad background colour */ border-radius: 3px; border: 1px solid #CCC; padding: 0.5em 0.7em; display: block !important; /* added to counteract the Yahoo-specific `code` rule; without this, code blocks in Blogger are broken */ } /* In edit mode, Wordpress uses a `* { font: ...;} rule+style that makes highlighted code look non-monospace. This rule will override it. */ .markdown-here-wrapper[data-md-url*="wordpress."] code span { font: inherit; } /* Wordpress adds a grey background to `pre` elements that doesn't go well with our syntax highlighting. */ .markdown-here-wrapper[data-md-url*="wordpress."] pre { background-color: transparent; } /* This spacing has been tweaked to closely match Gmail+Chrome "paragraph" (two line breaks) spacing. Note that we only use a top margin and not a bottom margin -- this prevents the "blank line" look at the top of the email (issue #243). */ p { /* !important is needed here because Hotmail/Outlook.com uses !important to kill the margin in <p>. We need this to win. */ margin: 0 0 1.2em 0 !important; } table, pre, dl, blockquote, q, ul, ol { margin: 1.2em 0; } ul, ol { padding-left: 2em; } li { margin: 0.5em 0; font-size: 16px; } /* Space paragraphs in a list the same as the list itself. */ li p { /* Needs !important to override rule above. */ margin: 0.5em 0 !important; } /* Smaller spacing for sub-lists */ ul ul, ul ol, ol ul, ol ol { margin: 0; padding-left: 1em; } /* Use letters for unordered-lists. (Like Github.) */ ul ul, ul, ul { list-style-type: square; font-size: 16px; } /* Use letters for sub-ordered-lists. (Like Github.) */ ol ol, ul ol { list-style-type: lower-roman; } /* Use Roman numerals for sub-sub-ordered lists. (Like Github.) */ ul ul ol, ul ol ol, ol ul ol, ol ol ol { list-style-type: lower-alpha; } dl { padding: 0; } dl dt { font-size: 1em; font-weight: bold; font-style: italic; } dl dd { margin: 0 0 1em; padding: 0 1em; } blockquote, q { border-left: 4px solid #DDD; padding: 0 1em; color: #777; quotes: none; } blockquote::before, blockquote::after, q::before, q::after { content: none; } h1, h2, h3, h4, h5, h6{margin:20px 0 10px; padding:0; font-weight: bold; color:#009688;} h1{font-size:24px; border-bottom:1px solid #ddd;} h2{font-size:22px; border-bottom:1px solid #eee;} h3{font-size:20px;} h4{font-size:18px;} h5{font-size:16px;} h6{font-size:16px; color:#777;} table { padding: 0; border-collapse: collapse; border-spacing: 0; font-size: 1em; font: inherit; border: 0; } tbody { margin: 0; padding: 0; border: 0; } table tr { border: 0; border-top: 1px solid #CCC; background-color: white; margin: 0; padding: 0; } table tr:nth-child(2n) { background-color: #F8F8F8; } table tr th, table tr td { font-size: 1em; border: 1px solid #CCC; margin: 0; padding: 0.5em 1em; } table tr th { font-weight: bold; background-color: #F0F0F0; } p { font-size: 16px; line-height: 1.75em; padding-right: 0.5em; padding-left: 0.5em; } strong, b{color:#BF360C;}
預覽
樣式二
/*----------配置主體、標題、段落、列表等元素的樣式-------------*/ body { font-family: "Avenir Next", Helvetica, Arial, sans-serif; padding:1em; margin:auto; max-width:42em; background:#fefefe; } h1, h2, h3, h4, h5, h6 { font-weight: bold; } h1 { color: #000000; font-size: 28pt; border-bottom: 1px solid #CCCCCC; } h2 { color: #000000; font-size: 24px; } h3 { 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: #DC143C; background-color: #DC143C; } p, blockquote, ul, ol, dl, li, table, pre { margin: 15px 0; } /*----------配置主體、標題、段落、列表、引用等元素的樣式-------------*/ /*--------------body,h1~h6,p,ol\ul\dl\li\table\p\blockquote-----*/ /*-------a標簽配置鏈接屬性----------*/ a, a:visited { color: #4183C4; background-color: inherit; text-decoration: none; } /**------#號標記id,作為id選擇器來配置屬性------**/ #message { border-radius: 6px; border: 1px solid #ccc; display:block; width:100%; height:60px; margin:6px 0px; } button, #ws { font-size: 10pt; padding: 4px 6px; border-radius: 5px; border: 1px solid #bbb; background-color: #eee; } code, pre, #ws, #message { font-family: Consolas; /*代碼字體樣式*/ font-size: 12pt; } code { border: 1px solid #EAEAEA; margin: 0 2px; padding: 0 5px; } pre { border: 1px solid #CCCCCC; overflow: auto; padding: 2px 2px; } pre > code { /*子選擇器*/ border: 0; margin: 0; padding: 0; } #ws { background-color: #DC143C; } /*類選擇器設置*/ .send { color:#77bb77; } .server { color:#7799bb; } .error { color:#AA0000; } table tr:nth-child(2n) {/*包含選擇器,:為偽類*/ background-color: #DC143C; } /* Monokai style - ported by Luigi Maselli - http://grigio.org */ /*____________highlight.js 的屬性配置,主要用於代碼高亮___________________*/ .hljs { display: block; overflow-x: auto; padding: 0.5em; background: #272822; color: #ddd; } .hljs-tag, .hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-strong, .hljs-name { color: #f92672; } .hljs-code { color: #66d9ef; } .hljs-class .hljs-title { color: white; } .hljs-attribute, .hljs-symbol, .hljs-regexp, .hljs-link { color: #bf79db; } .hljs-string, .hljs-bullet, .hljs-subst, .hljs-title, .hljs-section, .hljs-emphasis, .hljs-type, .hljs-built_in, .hljs-builtin-name, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-addition, .hljs-variable, .hljs-template-tag, .hljs-template-variable { color: #a6e22e; } .hljs-comment, .hljs-quote, .hljs-deletion, .hljs-meta { color: #75715e; } .hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-title, .hljs-section, .hljs-type, .hljs-selector-id { font-weight: bold; }
預覽
樣式三
.markdown-here-wrapper {/*markdown here 的全局配置*/ font-size: 16px; line-height: 1.8em; /*em指的是相對單位,當前對象內字體的尺寸,默認瀏覽器16px*/ /*http://www.w3school.com.cn/cssref/css_units.asp*/ letter-spacing: 0.1em; } pre, code { /*,逗號連接是並集選擇器*/ font-size: 14px; font-family: Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace; margin: auto 5px; } /*設置pre 和code的整體屬性,pre可以把div中的/r/n保存下來顯示,而code則用瀏覽器的方式渲染*/ code { white-space: pre-wrap; border-radius: 2px; display: inline; } /*display 的屬性為指定元素框的類型*/ /*margin: 0為默認值,auto為瀏覽器自動計算的外邊距,外邊距屬性*/ /*border-radius: div元素的圓角框*/ /*write-space:如何處理元素內空白行,回車or忽略,nowrap不換行,pre-wrap換行*/ /*http://www.w3school.com.cn/cssref/pr_text_white-space.asp*/ pre { /*pre 元素可定義預格式化的文本。被包圍在 pre 元素中的文本通常會保留空格和換行符。而文本也會呈現為等寬字體。*/ font-size: 15px; line-height: 1.4em; display: block; !important; /*在ie6以上的瀏覽器中,設置優先級,覆蓋預先設置的屬性 !important*/ } pre code { /*空格連接是后代選擇器,外層在前內層在后; >連接是子元素選擇器*/ white-space: pre; overflow: auto; /*內容益處元素框時候的行為*/ border-radius: 3px; padding: 1px 1px; display: block !important; } /*各種選擇器:https://blog.csdn.net/m0_38070602/article/details/69950795*/ /*pre code 的解釋:http://www.cnblogs.com/lizonghui/archive/2012/09/18/2692355.html*/ strong, b{ /*strong表示強調,用<b>粗體顯示,也可以自定義自己的強調方式*/ color: #BF360C; } em, i { /*em表示強調,用<i>標簽斜體顯示,也可以自定義自己的強調方式*/ color: #009688; } hr { /*水平線分割---*/ border: 1px solid #BF360C; margin: 1.5em auto; } p { /*段落選擇器*/ margin: 1.5em 5px !important; /*顏色*/ color:#d6a841; /*字體*/ font-family:'微軟雅黑'; /*字號*/ font-size:15px; /*行間距,可用百分比,數值倍數,像素設置,還包括text-indent縮進、letter-spacing字間距、*/ line-height:100% 2 100px; /*段間距,一般用margin屬性調整*/ margin-bottom:20px; /*頁邊距用padding屬性調整*/ } /*表格和*/ table, pre, dl, blockquote, q, ul, ol { margin: 10px 5px; /*並集選擇器:表格、預格式化、定義列表、塊引用、短引用、無序列表、有序列表*/ } ul, ol { /*無序、有序列表*/ padding-left: 15px; } li { /* 定義列表中的項目*/ margin: 10px; } li p { /*li列表元素中的后代選擇器,包含選擇器,應用於li中的p*/ margin: 10px 0 !important; } ul ul, ul ol, ol ul, ol ol { /*各個后代選擇器一起添加屬性*/ margin: 0; padding-left: 10px; } ul { list-style-type: circle; } /*無序列表的前綴,circle,square,好多種,同樣有序列表ol也可以設置不同的標記*/ /*http://www.w3school.com.cn/cssref/pr_list-style-type.asp*/ dl { padding: 0; } dl dt { font-size: 1em; font-weight: bold; /*加粗 意大利斜體*/ font-style: italic; } dl dd { margin: 0 0 10px; padding: 0 10px; } /*各種表格的包含選擇器定義,用空格連接*/ blockquote, q { border-left: 2px solid #009688; padding: 0 10px; /*上右下左的排序,可輸入四個值*/ color: #777; quotes: none; margin-left: 1em; } /*塊引用和短引用的樣式*/ blockquote::before, blockquote::after, q::before, q::after { content: none; } /*before 和after屬於css偽元素,:before在元素之前插入相應。:after在之后插入*/ /*偽元素用::,偽類用:參考ref。。https://blog.csdn.net/qq_25292481/article/details/52577320*/ /*--------同時設置六級標題的屬性,其中!important用於指定優先級>ie6--------------*/ h1, h2, h3, h4, h5, h6 { margin: 20px 0 10px; padding: 0; font-style: bold !important; color: #009688 !important; text-align: center !important; margin: 1.5em 5px !important; padding: 0.5em 1em !important; } h1 { font-size: 24px !important; border-bottom: 1px solid #ddd !important; } h2 { font-size: 20px !important; border-bottom: 1px solid #eee !important; } h3 { font-size: 18px; } h4 { font-size: 16px; /*可以針對自己的標題做出個性化設置*/ color:#d6a841 /*16進制顏色*/ font-style: bold /*加粗?傾斜*/ /*---------各種居中方式---------*/ margin: 0, auto; /*塊級元素居中*/ text-align: center; /*行內居中*/ justify-content: center; /*對齊*/ vertical-align: middle; /*垂直居中*/ /*ref: https://www.jianshu.com/p/61c431fd924a*/ } /*-------------表格元素的設置-----------------*/ table { padding: 0; border-collapse: collapse; /*合並邊框屬性*/ border-spacing: 0; font-size: 1em; font: inherit; border: 0; margin: 0 auto; } tbody { margin: 0; padding: 0; border: 0; } table tr { border: 0; border-top: 1px solid #CCC; background-color: white; margin: 0; padding: 0; } table tr:nth-child(2n) { background-color: #F8F8F8; } table tr th, table tr td { font-size: 16px; border: 1px solid #CCC; margin: 0; padding: 5px 10px; } table tr th { /*表格。tableraw,tableheader*/ font-weight: bold; color: #eee; border: 1px solid #009688; background-color: #009688; } ---------- 可根據markdown的實現自己的**個性化**標記 @strong-char: "**"; /*可以將着重符號替換為自己的個性化符號*/ strong:before, strong:after { content: @strong-char; display: inline; } @em-char: "*"; em:before, em:after { content: @em-char; display: inline; } /*https://github.com/mrcoles/markdown-css/blob/master/markdown.less*/ /*http://www.jb51.net/css/357685.html*/ /*<span>行內封裝,<div>塊級封裝*/ /*copy from jianshu*/ /*source code:https://www.jianshu.com/p/7bda360950ce*/
預覽