Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67469

Background highlight text in a code block?

$
0
0

My goal is to be able to display something like this:

I want to background highlight a piece of code inside a code block that already has syntax highlighting. I want to do this on a markdown file I have on Github that is hosted on Github Pages (can use kramdown markdown, html, css).

I am aware that you can have syntax highlighting inside a code block doing something like this:

```java
int foo (void) {
    int i;
}
```

I am also aware that I can background highlight text inside a code block by doing something like this:

<pre><code>int foo (void) {
    <span style="background-color:yellow">int i;</span>
}
</code></pre>

But how do I combine these two things?


Viewing all articles
Browse latest Browse all 67469

Trending Articles