How to change the color of specific words within a Quarto document?

The problem: Say you have a sentence, "I love R". How would you change the color of just the word "love" to red?

Prior knowledge: I'm aware of the use of Sass in Quarto, but these seem to change whole chunks of text.

/*-- scss:defaults --*/
$presentation-heading-color: green;

/*-- scss:rules --*/

Using CSS to be more specific:

/*-- scss:defaults --*/
$custom-col: green;

/*-- scss:rules --*/

.reveal section h2 {
  color: $custom-col;
}

See https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans .
And for a one-off you can also include in the text a line with
I <span style="color:red;">love</span> R.

EDIT: interchanged the love and R part.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.