How to align left html_document rendered by rmarkdown?

别来无恙 提交于 2019-12-12 04:58:57

问题


Since I am not familiar with css I was wondering if there is a simple way to "tell" my rmarkdown page to left align when rendering an HTML-page?

Something like this:

---
title: "My html-page"
output:
 html_document:
  body_placement: left 
---

回答1:


Maybe something like this:

---
title: "My html-page"
output: html_document
---
<style>
body {
    position: absolute;
    left: 0px;}
</style>



回答2:


If you'd actually like some basic styles (i.e. not my theme:null suggestion), grab Skeleton and put normalize.css & skeleton.css in the same directory as your Rmd file. Then you can do:

---
title: "Title"
output:
  html_document:
    theme: null
    css: 
      - normalize.css
      - skeleton.css
    keep_md: true
  md_document:
    variant: markdown_github
---

One

Two

```{r}
print("three")
```

which will result in:

You can add a third - my.css if you want to customize it a bit more.



来源:https://stackoverflow.com/questions/34897498/how-to-align-left-html-document-rendered-by-rmarkdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!