I'm trying to insert an image into the upper right hand corner of an rmarkdown document, but the image won't float right. I'm trying to get it so that it isn't overlapping the text.
---
title: "My Report"
output:
html_document:
toc: true
toc_float: true
toc_depth: 2
params:
case: case
---
```{js logo-js, echo=FALSE}
$(document).ready(function() {
$('#header').parent().prepend('<div id=\"logo\"><img src=\"https://www.w3schools.com/images/lamp.jpg\" style=\"position:absolute; top:0; right:0; padding:20px; height:170px\"></div>');
$('#header').css('margin-right', '0px')
});
```
```{css, echo=FALSE}
.main-container {
#max-width: 1600px;
margin-left: 0;
margin-right: 0;
}
```
```{r setup, echo=FALSE, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
print_option <- TRUE
```
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker includ
<p> </p>
Which looks like this:
I have also tried inserting the image this way, but the same behavior persists.
htmltools::img(src = knitr::image_uri(file.path("https://www.w3schools.com/images/lamp.jpg")),
alt = 'logo',
style = 'position:absolute; top:0; right:0; padding:10px;')
