I want to have my YAML header information centered on my html document.
I want everything else left alligned as normal.
Can I apply any html or other code to the YAML header to make this happen?
How do I do this??
Example:
I have:
---
title: "Shiny HTML Doc"
author: "theforestecologist"
date: "Apr 14, 2017"
output: html_document
runtime: shiny
---
Here is some css styling that you can use to accomplish what you need.
h1.title
CSS selectorh4.author
CSS selectorh4.date
CSS selectorHere is the code:
---
title: "Shiny HTML Doc"
author: "theforestecologist"
date: "Apr 14, 2017"
output: html_document
runtime: shiny
---
<style type="text/css">
h1.title {
font-size: 38px;
color: DarkRed;
text-align: center;
}
h4.author { /* Header 4 - and the author and data headers use this too */
font-size: 18px;
font-family: "Times New Roman", Times, serif;
color: DarkRed;
text-align: center;
}
h4.date { /* Header 4 - and the author and data headers use this too */
font-size: 18px;
font-family: "Times New Roman", Times, serif;
color: DarkBlue;
text-align: center;
}
</style>
# H1 Header
Some body text
## H2 Header
More body text
```{r echo=T}
n <- 100
df <- data.frame(x=rnorm(n),y=rnorm(n))
```
And this is what it looks like in then end:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With