Jaskeil
Jaskeil

Reputation: 1232

How do I change the entire background color in an RMarkdown HTML Document?

I want to change the background of my RMarkdown document to a very light grey. I discovered how to change themes from this link and I really love the flatly theme. However, I would like to change the entire background to a light grey. See image and output document code below

output:
  html_document:
    highlight: monochrome
    theme: flatly

enter image description here

Upvotes: 4

Views: 7657

Answers (1)

jwarz
jwarz

Reputation: 531

Just add custom CSS to your document. You can place this line at the top (after the yaml part):

1. Inline Style

<body style="background-color:grey;">

2. Embedded Style Sheet

<style>
    body { background-color: grey; }
    pre, pre:not([class]) { background-color: red; }
</style>

Upvotes: 10

Related Questions