【问题标题】:Is there a way to override default color in posterdown package using CSS?有没有办法使用CSS覆盖posterdown包中的默认颜色?
【发布时间】:2021-05-27 17:01:38
【问题描述】:

我在 R Markdown 的 posterdown 包中使用 posterdown_html 模板。有什么方法可以覆盖标题中使用的默认绿色,每个部分的标题和所有使用 CSS 的超链接?我想将其更改为以下 html 颜色代码 (6d1d26),但是我不确定如何使用 CSS 来执行此操作

这是此模板的默认 YAML 的 sn-p

---
title: Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown
author:
  - name: Brent Thorne
    affil: 1
    orcid: '0000-0002-1099-3857'
  - name: Another G. Author
    affil: 2
affiliation:
  - num: 1
    address: Department of Earth Science, Brock University
  - num: 2
    address: Department of Graphics and Layouts, University of Posters; Canada
column_numbers: 3
logoright_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/images/betterhexlogo.png
logoleft_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/images/betterhexlogo.png
output: 
  posterdown::posterdown_html:
    self_contained: false
bibliography: packages.bib
knit: pagedown::chrome_print
---

【问题讨论】:

    标签: html r r-markdown


    【解决方案1】:

    看起来这一切都可以在 YAML 标头中完成 https://github.com/brentthorne/posterdown/wiki/posterdown_html

    【讨论】:

      【解决方案2】:

      您也可以使用内联 CSS,如果您非常了解 CSS,您将可以更好地控制您的 posterdown 文档。但这里是您可以使用的内联 CSS 的简化版。正如另一个答案所暗示的那样,您可以在 YAML 中进行控制,这也很好。

      ---
      title: Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown
      author:
        - name: Brent Thorne
          affil: 1
          orcid: '0000-0002-1099-3857'
        - name: Another G. Author
          affil: 2
      affiliation:
        - num: 1
          address: Department of Earth Science, Brock University
        - num: 2
          address: Department of Graphics and Layouts, University of Posters; Canada
      column_numbers: 3
      output: 
        posterdown::posterdown_html:
          self_contained: false
      knit: pagedown::chrome_print
      ---
      
      ```{css, echo=FALSE}
      div.title_container{
         background-color: #6d1d26;
      }
      
      div.logo_left{
        background-color: #6d1d26;
      }
      div.logo_right{
        background-color: #6d1d26;
      }
      ```
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-10-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多