Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用CSS以语法高亮显示为目标来更改显示代码的字体大小_Css_Wordpress_Syntax Highlighting - Fatal编程技术网

如何使用CSS以语法高亮显示为目标来更改显示代码的字体大小

如何使用CSS以语法高亮显示为目标来更改显示代码的字体大小,css,wordpress,syntax-highlighting,Css,Wordpress,Syntax Highlighting,我正在寻找目标的wordpress语法与css来改变默认的字体大小,我不能添加任何有用的css类的div的,我似乎不能针对它没有针对所有div的全球 下面是从g-chrome到自动生成的div,再到代码的完整css路径 div#"individual-ID-for-each-code-example-here".syntaxhighliter div.lines div.line.alt1 table tbody tr td.content code.string 我试过瞄准。SyntaxH

我正在寻找目标的wordpress语法与css来改变默认的字体大小,我不能添加任何有用的css类的div的,我似乎不能针对它没有针对所有div的全球

下面是从g-chrome到自动生成的div,再到代码的完整css路径

 div#"individual-ID-for-each-code-example-here".syntaxhighliter div.lines div.line.alt1 table tbody tr td.content code.string
我试过瞄准。SyntaxHighl和所有其他人,包括没有运气的pre,有什么简单的东西我错过了吗

以下是html:

<pre class="brush: php; title: ; notranslate" title="">

<!--CODE GOES HERE-->

</pre>

如果有帮助,以下是页面本身:


使用这种方法有什么问题:

.syntaxhighliter table tbody tr .code code.string {
    font-size: 12pt !important;
}
截图


完整图像…使用这种方法有什么问题:

.syntaxhighliter table tbody tr .code code.string {
    font-size: 12pt !important;
}
截图


完整图像…感谢Praveen Kumar的贡献,但是指向的.css文件只会更改默认主题的字体大小,如果我以后选择交换主题,字体大小将恢复

我更改了shCore.css中的字体大小,因为这将应用于所有主题模板。(语法高亮显示2中的第56行)

社联提到:

.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody
{
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: none !important;
    text-align: left !important;
    float: none !important;
    vertical-align: baseline !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    height: auto !important;
    width: auto !important;
    line-height: 1.1em !important;
    font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
    font-weight: normal !important;
    font-style: normal !important;

    font-size: 0.98em !important; <- This! (Reduced from 1em, surprisingly this was enough)

    /*min-height: inherit !important; *//* For IE8, FF & WebKit */
    /*min-height: auto !important;*/ /* For IE7 */
    direction: ltr !important;
}
.syntaxhighlighter,
.syntaxhighlighter分区,
.syntaxhighlighter代码,
.荧光灯表,
.syntaxhighlighter表td,
.syntaxhighlighter表tr,
.合成荧光灯桌体
{
边距:0!重要;
填充:0!重要;
边界:0!重要;
大纲:0!重要;
背景:无!重要;
文本对齐:左!重要;
浮动:无!重要;
垂直对齐:基线!重要;
位置:静态!重要;
左:自动!重要;
顶部:自动!重要;
右:自动!重要;
底部:自动!重要;
高度:自动!重要;
宽度:自动!重要;
线高:1.1米!重要;
字体系列:“Consolas”、“Bitstream Vera Sans Mono”、“Courier New”、Courier、monospace!重要;
字体大小:正常!重要;
字体风格:正常!重要;

字体大小:0.98em!重要;感谢Praveen Kumar的贡献,但是指向的.css文件只会更改默认主题的字体大小,如果我以后选择交换主题,字体大小将恢复

我更改了shCore.css中的字体大小,因为这将应用于所有主题模板。(语法高亮2中的第56行)

社联提到:

.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody
{
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: none !important;
    text-align: left !important;
    float: none !important;
    vertical-align: baseline !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    height: auto !important;
    width: auto !important;
    line-height: 1.1em !important;
    font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
    font-weight: normal !important;
    font-style: normal !important;

    font-size: 0.98em !important; <- This! (Reduced from 1em, surprisingly this was enough)

    /*min-height: inherit !important; *//* For IE8, FF & WebKit */
    /*min-height: auto !important;*/ /* For IE7 */
    direction: ltr !important;
}
.syntaxhighlighter,
.syntaxhighlighter分区,
.syntaxhighlighter代码,
.荧光灯表,
.syntaxhighlighter表td,
.syntaxhighlighter表tr,
.合成荧光灯桌体
{
边距:0!重要;
填充:0!重要;
边界:0!重要;
大纲:0!重要;
背景:无!重要;
文本对齐:左!重要;
浮动:无!重要;
垂直对齐:基线!重要;
位置:静态!重要;
左:自动!重要;
顶部:自动!重要;
右:自动!重要;
底部:自动!重要;
高度:自动!重要;
宽度:自动!重要;
线高:1.1米!重要;
字体系列:“Consolas”、“Bitstream Vera Sans Mono”、“Courier New”、Courier、monospace!重要;
字体大小:正常!重要;
字体风格:正常!重要;

字体大小:0.98em!重要;我已经更新了CSS路径,因为它发生了轻微的变化,您可以再看一看吗?更新了答案,它是否有效?是否有一个地方可以检查工作HTML?您是否可以修改您的
shmotedefault.CSS
?我刚刚添加了这个
.syntaxhighlighter代码{字体大小:20px!重要;}
在你的
shmotedefault.css
中,它正在工作。使用Google Chrome的“源代码”面板本身进行检查。如果需要,将发布一个屏幕截图。让我们更新css路径,因为它稍有更改,你能再看一看吗?也更新了答案,它工作吗?有地方可以检查工作的HTML吗?可能吗允许您修改您的
shmotedefault.css
?我刚刚添加了这个
.syntaxhighlighter代码{font size:20px!important;}
在你的
shmotedefault.css中,它运行正常。使用Google Chrome的源代码面板本身进行检查。如果需要,将发布一个屏幕截图。让我们来看看,但它不是完全正确的,它不完全是未来的证明。如果我更改了模板,我将不得不将更改应用到另一个样式表中,这将非常简单,因为它涵盖了所有模板s、 实际上我根本没有提到CSS文件。我只是问你是否可以添加CSS。我只是从那里获取了参考。不管怎样。但它不是完全正确的,它不是完全可以证明未来的。如果我更改了模板,我将不得不将更改应用到另一个样式表,这更简单,因为它涵盖了所有模板。我实际上没有n CSS文件。我只是问你是否可以添加CSS。我只是从那里获取参考。无论如何。嗯,一个gh。使用
div#highlighter\uID在这里。syntaxhighlighter div.lines div.line.alt1 table tbody tr td.content code.string
起作用。当然有
!important
作为覆盖。悬赏是否仍然有效解决了?嗯,一个gh。使用
div#highlighter\uID到这里。syntaxhighlighter div.lines div.line.alt1 table tbody tr td.content code.string
工作。当然可以使用
!important
作为覆盖。悬赏仍然有效还是解决了?