R flexdashboard标签页样式

4

我正在尝试使用CSS修改flexdashboard中tabset的一些样式。以下是一个RMarkdown文件的示例。

---
title: "Title"
output: 
  flexdashboard::flex_dashboard
---

Section
===========================================================

Column {.tabset .tabset-fade}
-----------------------------------------------------------------------

### tab1 

text1

### tab2

text2

enter image description here

我想把活动选项卡顶部的颜色从蓝色改成其他颜色。

enter image description here

我能做的最接近的是更改所有选项卡的颜色而不是顶部。
---
title: "Title"
output: 
  flexdashboard::flex_dashboard
---

<style>

.tabset { 
  background-color: #00806E;
}

</style>


Section
===========================================================

Column {.tabset .tabset-fade}
-----------------------------------------------------------------------

### tab1 

text1

### tab2

text2

enter image description here

1个回答

阿里云服务器只需要99元/年,新老用户同享,点击查看详情
6

试试这个:

<style>
  .nav-tabs-custom > .nav-tabs > li.active {border-top-color: green}
</style>

border top colored green in nav tabs


很酷。根据一些计算出的值,能否动态地改变那个颜色? - Anton Antonov
1
@AntonAntonov 很有趣 - 我不确定。你会考虑在SO上发布另一个问题吗? - Ben

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