简体   繁体   中英

Why does using css break tabset in Rmarkdown

I have found that if I specify the css for a section then it breaks the {.tabset} for that section of the document. Please see the bellow example.

Is there any way to stop this?

---
title: "test"
output: html_document
---

<style type="text/css">
.mycontent{
}
</style>

# R Markdown

Some text

# Sets of working tabs {.tabset}
## Tab 1
## Tab 2

#
<div class="mycontent">
# Sets of broken tabs {.tabset}
## Tab 1
## Tab 2
</div>

The document:

在此处输入图片说明

You can custom specific sections with CSS chunk by adding ids or classes to section header, see 3.1.4.1 Custom CSS . Obviously, you can ignore the CSS style applied below.

---
title: "test"
output: html_document
---

```{css my-content, echo = FALSE}
.mycontent{
  float: right;
  color: blue;
}
```

# R Markdown

Some text

# Sets of working tabs {.tabset}
## Tab 1
## Tab 2

# Sets of broken tabs {.tabset .mycontent}
## Tab 1
## Tab 2

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM