gpt4 book ai didi

html - 在 html 文件中自定义嵌入式 Git Gist 文本大小

转载 作者:太空狗 更新时间:2023-10-29 13:37:23 29 4
gpt4 key购买 nike

我的 html 页面上有一个嵌入式 Gist 来显示一些代码。我想知道是否有办法编辑其默认字体大小?在网上搜索后,有人建议覆盖 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 代码(在头部)

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

关于html - 在 html 文件中自定义嵌入式 Git Gist 文本大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39676920/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com