我有一个嵌入的要点在我的html页面上显示一些代码。我想知道是否有一种方法来编辑其默认字体大小?在网上搜索后,一些人建议重写gist的css。我不是很精通html或css,所以为新手问题道歉。
这是我的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>
这个主意对吗?
在我的测试中,我更新了.gist .blob-code-inner
以覆盖gist的默认字体设置。然而,它确实要求!important
这样做。根据你得到的具体程度,你可能不需要在你的样式中添加!important
。
CSS代码(in head)
.gist .blob-code-inner{ font-size:20px !important; }