Highlighting lines in different colors in SyntaxHighlighter

In SyntaxHighlighter, is it possible to highlight lines with different colors (for example, some green lines, others blue)?

+4
source share
5 answers

I don’t know SyntaxHighlighter, but looking at the site it seems that you can select one color, but you have nothing to use several selection colors.

The only thing I can offer is to contact the author and offer it as a feature request.

0
source

Like @MatTheCat, change the background color to class alt1 and / or alt2

.syntaxhighlighter .line.alt1 { background-color: white !important; } .syntaxhighlighter .line.alt2 { background-color: #F8F8F8 !important; } 
+4
source

Each row is a class that shows the row number (), so apply a background color to the class you want.

+1
source

Version 3.0.83 supports the selection of certain lines. See http://alexgorbatchev.com/SyntaxHighlighter/manual/demo/highlight.html

0
source
 <pre class="brush: php; html-script: true; highlight: [1, 2, 3, 4, 5, 6]"> line 1 line 2 line 3 line 4 line 5 line 6 </pre> 

this will highlight lines 1 through 6. Check the documentation: http://alexgorbatchev.com/SyntaxHighlighter/manual/demo/highlight.html

0
source

All Articles