Pagedown: how to change the photo position in html_resume

Created on 7 Sep 2019  ·  2Comments  ·  Source: rstudio/pagedown

Hi,

title: "Lijia Yu's resume"
author: Lijia Yu
date: "`r Sys.Date()`"
output:
  pagedown::html_resume:
    # set it to true for a self-contained HTML page but it'll take longer to render
    self_contained: false
---

Aside
================================================================================


![Lijia Yu](https://avatars1.githubusercontent.com/u/895125?s=400&v=4){width=80%}

The photo position is not aligned with the introduction text on the left side. So ,is there a way to make the photo position go up a little bit?

issues

Here is what I expect.

expect

Thanks for your help.

Most helpful comment

It is possible to achieve using CSS.
In order to understand how to adapt the CSS styles to your need, the best thing to do is to use Chrome Developer Tools (F12 or right click on the page then _Inspect_).

When you do this, you get this screen:
resume-img

The vertical space comes first from the padding of the div element of class aside. There is also a vertical space due to the margin of its p element (the one which contains the image).

Therefore, you can get rid off this vertical space like this:

---
title: "Lijia Yu's resume"
author: Lijia Yu
date: "`r Sys.Date()`"
output:
  pagedown::html_resume:
    # set it to true for a self-contained HTML page but it'll take longer to render
    self_contained: false
---

```{css, echo=FALSE}
.aside {
  padding-top: 0;
}

.aside > p:first-of-type {
  margin-top: 0;
}
```

Aside
================================================================================


![Lijia Yu](https://avatars1.githubusercontent.com/u/895125?s=400&v=4){width=80%}

All 2 comments

It is possible to achieve using CSS.
In order to understand how to adapt the CSS styles to your need, the best thing to do is to use Chrome Developer Tools (F12 or right click on the page then _Inspect_).

When you do this, you get this screen:
resume-img

The vertical space comes first from the padding of the div element of class aside. There is also a vertical space due to the margin of its p element (the one which contains the image).

Therefore, you can get rid off this vertical space like this:

---
title: "Lijia Yu's resume"
author: Lijia Yu
date: "`r Sys.Date()`"
output:
  pagedown::html_resume:
    # set it to true for a self-contained HTML page but it'll take longer to render
    self_contained: false
---

```{css, echo=FALSE}
.aside {
  padding-top: 0;
}

.aside > p:first-of-type {
  margin-top: 0;
}
```

Aside
================================================================================


![Lijia Yu](https://avatars1.githubusercontent.com/u/895125?s=400&v=4){width=80%}

Great! It works well for me. :smile:

Thanks for your help.

Was this page helpful?
0 / 5 - 0 ratings