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

Jaskeil

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

jwarz

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>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I change the background color with JavaScript?

How do I change the background color of a JFrame dynamically?

How do I change a tab background color when using TabLayout?

How do I change the background color of the ActionBar of an ActionBarActivity using XML?

How do I change the background color of a QtQuick Window?

How do I change the background color of a button in Kivy?

How do I change the background color of the body?

I want to change the background color of the HTML document by pressing the enter key

How do you change the background color of your HTML document using JavaScript

How do I change the background color of a unicode symbol?

How do I change the ripple background color on Button?

How do I change a background color in JS?

How do I change the background color in JavaScript?

How can I change the background color of the body in index.html?

How do I change the background color of a tabbed page in Xamarin iOS?

How do I change the vuetify theme background color

gvim how to change entire background color

How do I change the Windows 8.1 background color?

How Can I change the background color of HTML meter?

How do I change the font color of a specific letter throughout the entire MS Word 2007 document?

How to change entire navigatorbar background color on xPage?

How do I change button background and text color?

how do I change my header background color?

How do I set a background color for the theme of my entire MaterialApp?

How do I make the entire width of a menu item change background color when hovered over?

How do you change the entire column background color of a grid column?

How do i change the background color of my website with HTML

How do i change input field background color based on onclick?

How do I change the background color of a cell in Pandas?