1. 当我们要自定义网站样式的时候

styles 自定义页面样式, 默认情况下各generator对应的css文件

"styles": {
    "website": "styles/website.css",
    "ebook": "styles/ebook.css",
    "pdf": "styles/pdf.css",
    "mobi": "styles/mobi.css",
    "epub": "styles/epub.css"
}

例如使<h1> <h2>标签有下边框, 可以在website.css中设置

h1 , h2{
        border-bottom: 1px solid #EFEAEA;
}

在gitbook根目录创建styles/website.css就可以自定义样式。

2. website.css配置文件

/* CSS for website */ h1 , h2{ border-bottom: 1px solid #EFEAEA; padding-bottom: 3px; } .markdown-section>:first-child { margin-top: 0!important; } .page-wrapper { margin-top: -1.275em; } .book .book-body .page-wrapper .page-inner section.normal { min-height:350px; margin-bottom: 30px; } .book .book-body .page-wrapper .page-inner section.normal hr { height: 0px; padding: 0; margin: 1.7em 0; overflow: hidden; background-color: #e7e7e7; border-bottom: 1px dotted #e7e7e7; } .video-js { width:100%; height: 100%; } pre[class*="language-"] { border: none; background-color: #f7f7f7; font-size: 1em; line-height: 1.2em; } .book .book-body .page-wrapper .page-inner section.normal { font-size: 16px; font-family: "ubuntu", "Tahoma", "Microsoft YaHei", arial, sans-serif; } .aceCode { font-size: 14px !important; } input[type=checkbox]{ margin-left: -2em; } .page-footer span{ font-size: 12px; } .page-footer .copyright { float: left; } .body, html { overflow-y: hidden; } .versions-select select { height: 2em; line-height: 2em; border-radius: 4px; background: #efefef; }

注意文件中的如下风格会让prism的代码风格失效。

pre[class*="language-"] {
    border: none;
    background-color: #f7f7f7;
    font-size: 1em;
    line-height: 1.2em;
}

results matching ""

    No results matching ""