title: Caption above figure in html Rmarkdown
body: <p>Is it possible to move the caption above my figure when knitting to HTML in RMarkdown? It seems that it is possible in PDF, ie <a href="https://stackoverflow.com/questions/24657216/caption-above-figure-using-knitr-latex-pdf">when knitting to PDF</a>, but I can't figure out how to replicate this for HTML. I am using <code>bookdown</code> to number figures.</p>
  
  <p>When I run something like this:</p>
  
  <pre><code>```{r fig.cap= "caption"}
  df &lt;- data.frame(letter = letters[1:5], value = 1)
  
  ggplot(df, aes(as(factor(1), value, fill = letters))) +
    geom_bar(stat = "identity")
  
  ```
  </code></pre>
  
  <p>the caption is displayed at the bottom of the figure, but I would like to display it above the figure.</p>