7.1 Apply custom CSS
For beginners, it is extremely important to understand selectors and precedence of rules in CSS, otherwise you may be confused why your custom CSS rules do not work as expected (they may not have enough precedence).
To include one or multiple custom stylesheets in an Rmd document, you can use the
css option, e.g.,
To include multiple stylesheets, you may list them in brackets, e.g.,
Alternatively, you can use a
css code chunk to embed the CSS rules directly in your Rmd document, e.g.,
The chunk option
echo = FALSE means the CSS code will not be displayed verbatim in the output, but a
<style> tag containing the CSS code will be generated to the HTML output file.
Xie, Yihui, Alison Presmanes Hill, and Amber Thomas. 2017. Blogdown: Creating Websites with R Markdown. Boca Raton, Florida: Chapman; Hall/CRC. https://github.com/rstudio/blogdown.