Don't want to admit how long I have been struggling to do this (even with the help of copilot - I can't get it right) #12951
-
DescriptionI am trying to customize the html output from quarto. Specifically, I want each header (and only the headers - not the content beneath the headers) to have a colored fill and a border. Also, I am only able to get the headers to span the main body of the report but I really want the headers and content to start from the main body and extend right to the right edge (with a little padding on right edge), so effectively, I don't want a right margin or there is no content on the right margin., so that main body can take up the right 2/3s of the screen. On the left side, I want a TOC. The link here shows what I am trying to build (I used excel to create what I want quarto to create - can ignore the light grey cell borders) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hey @bujayherster, I'll break this into two parts! Firstly, to have your page content expand into the margin and sidebar (if there's no content there already), you'll want to add Second, you can use some CSS to colour your headings: main.content h1
main.content .h1,
main.content h2,
main.content .h2,
main.content h3,
main.content .h3,
main.content h4,.h4,
main.content h5,
main.content .h5,
main.content h6,
main.content .h6 {
background: red;
border: 2px solid yellow;
} Save this to a CSS file and add it to your document frontmatter using the |
Beta Was this translation helpful? Give feedback.
-
The below get's me 99% there. Now I would like to get the Date info that is just off right center to be moved to the right edge to align with the right edge of the shared header region. Any thoughts?
|
Beta Was this translation helpful? Give feedback.
-
This is probably close enough - thanks all for the help!
|
Beta Was this translation helpful? Give feedback.
Hey @bujayherster, I'll break this into two parts!
Firstly, to have your page content expand into the margin and sidebar (if there's no content there already), you'll want to add
page-layout: full
underformat.html
, either to your individual document frontmatter or your_quarto.yml
(to make it the default). Since you'll have a TOC on the left, content should stay out of there even with this option turned on.Second, you can use some CSS to colour your headings: