代码之家  ›  专栏  ›  技术社区  ›  Green Cell

自定义html文件中嵌入的Git Gist文本大小

  •  5
  • Green Cell  · 技术社区  · 10 年前

    我在html页面上嵌入了一个要点来显示一些代码。我想知道是否有办法编辑它的默认字体大小?搜索完网络后,一些人建议覆盖gist的css。我对html或css不太熟悉,所以对noob问题表示歉意。

    以下是我的html页面的片段:

    <html>
    <head>
    <style type="text/css">
    
    .gist .gist-file .gist-meta {
        font:30px "Helvetica Neue", Helvetica, arial, freesans, clean, sans-serif;
        text-shadow:1px 1px rgba(255,255,255,0.8);
        overflow:hidden;
        color:#999;
        background-color:#e8e8e8;
        background-image:linear-gradient(#fafafa,#e8e8e8);
        background-repeat:repeat-x;
        padding:10px;
    }
    
    </style>
    </head>
    
    <body>
    
    <script src="https://gist.github.com/ghost/754a9a308214f2db688e634b64d31597.js"></script>
    
    </body>
    
    </html>
    

    这个主意对吗?

    1 回复  |  直到 10 年前
        1
  •  6
  •   Greg McMullen    10 年前

    在我的测试中,我更新了 .gist .blob-code-inner 覆盖gist的默认字体设置。然而,它确实需要 !important 这样做。根据你的具体情况,你 也许 不需要添加 你的风格。

    CSS代码(头部)

    .gist .blob-code-inner{ font-size:20px !important; }