R Markdown ioslides 标题页面格式更改

3

我希望能够修改当我们将ioslides转换为HTML时出现的第一页的外观。以下是测试Rmd文件的标题:

    ---
    title: This test
    subtitle: that test
    author: jake
    output: 
       ioslides_presentation:
       incremental: true
       css: myCss4.css
    ---

我希望的是将标题置于中心位置(默认为左下角)并更改颜色和字体大小。我已经成功地更改了颜色和字体大小,但无法更改文本的位置...。
以下是我尝试过的自定义 CSS 代码:
    slides > slide.title-slide hgroup h1 {
      font-weight: bold;
      font-size: 24pt;
      color:red;
      bottom: 50%;
    }

我尝试过使用bottom:50%;、top=50%等方法,但未能成功...标题文本位置没有改变。我该怎么编码?或者有没有比css更好的方法?


尝试包含 position: absolute,然后添加 top: 100px 或您想要的任何位置。 - ytk
1
我以前尝试过这个。它会将标题向下移动。所以我现在尝试了top: -100px,它将标题向上移动...我不确定发生了什么。文本也折叠成了2行而不是一行。 - acs
1个回答

6

试着使用以下方法:

slides > slide.title-slide hgroup h1 {
  font-weight: bold;
  font-size: 24pt;
  color: red;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

2
谢谢您的建议,使标题消失了。 - acs
似乎我的标题也消失了,但是您提供的参数给了我一些线索。 - cloudscomputes

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接