Enlarging tabsets width

I am doing a notebook with R and i want to enlarge my tabsets width just as the title width like this :

but i didnt get the expected result. This is my R code :

---
title: "R Notebook"

output:
  html_document:
  html_notebook:
    toc: yes
    toc_depth: '2'
---

<style type="text/css">

body{   
    margin: 0 !important;
    padding: 0 !important;
    padding-left: 30px;
    background:#F0F0F0;
    max-width:830px;
    width:100%;}
    
h1.title {
  font-size: 40px;
  color: DarkBlue;
  background-color:#009ACD;
  width:144%;
  margin: 0 !important;
  padding: 0 !important;
  height:120px;
  margin-left:-100px;
}

h2 { /* Header 2 */
    font-size: 22px;
  color: #0020C2;
}

</style>


# {.tabset}

## Plots               
```{r}
summary(cars)

How can we fix it ?

Hi @joe003 and welcome to RStudio Community.

In the CSS of your notebook, you set the width of the h1 title to 144%. This is the reason why it appears wider than everything else:

h1.title {
   ...
   width: 144%
   ...
}

So, if you want the tabset to have the same width, you should also set it to 144% by adding this to the CSS code:

#section {
  width: 144%;
}
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.