【问题标题】:Font size not changing in RPresentationRPresentation 中的字体大小不变
【发布时间】:2016-04-22 11:17:01
【问题描述】:

我正在尝试使用 RStudio 更改我的 RPresentation 中的字体。虽然 font-size 适用于有序列表和无序列表,但我无法使其适用于自定义类。

<style>
.reveal p {font-size: 35px;}
.reveal ul,
.reveal ol {
  font-size: 25px;
}
.mypara1 {
  color: red;
  font-size: 10px;
}
.mypara2 {
  color: blue;
  font-size: 40px;
}

.redText {
  color: red;
  font-weight: bold;
}
.highlightGreen { background-color:#40FF00; }
.highlightOrange { background-color:#FE9A2E; }
</style>

ZTest
========================================================
author: Mickey
date: 



First Slide
========================================================

For more details on authoring R presentations click the
**Help** button on the toolbar.

- Bullet 1
- Bullet 2
- Bullet 3

<br>

<ol>
  <li>List1</li>
  <li>List2</li>
  <li>List3</li>
</ol>

Second Slide
========================================================

<h5> This is h5 font</h5>
<h6> This is h6 font</h6>

<span class="mypara1">mypara1 font-size: 10px</span><br>
<span class="mypara2">mypara2 font-size: 40px </span><br>
<small>Small Text </small><br>
<span class="highlightGreen">Green Highlight</span> <br>
<span class="redText">Red Text</span>

请参阅下面的屏幕截图... mypara1 和 mypara2 都以相同的大小显示,即使我为它们分配了不同的字体大小。,

【问题讨论】:

    标签: rstudio r-markdown


    【解决方案1】:

    Rpres CSS 中似乎有些东西覆盖了您的尝试。将字体大小映射到 span.mypara1 而不是 .mypara1 会产生预期的结果。

    span.mypara1 {
      color: red;
      font-size: 10px;
    }
    span.mypara2 {
      color: blue;
      font-size: 40px;
    }
    

    【讨论】:

    • @scoa,您的解决方案有效。谢谢!虽然我很想知道为什么颜色起作用而不是字体大小。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-08
    • 2013-03-29
    • 2011-10-18
    • 1970-01-01
    • 2011-11-27
    • 1970-01-01
    • 2019-03-09
    相关资源
    最近更新 更多