shaded blocks in tufte html

Section 9.6.2 of the RMarkdown Cookbook does a great job introducing custom shaded boxes that will work with html and markdown.

:::: {.blackbox data-latex=""}
::: {.center data-latex=""}

Thank you for noticing this **new notice**! Your noticing it has been noted, and _will be reported to the authorities_!

I'm using a tufte-style layout with margin notes. The example latex code for the preamble works as expected, but the css for the html version extends off the page.

.blackbox {
  padding: 1em;
  background: black;
  color: white;
  border: 2px solid orange;
  border-radius: 10px;
.center {
  text-align: center;

I added width: 55% to .blackbox and it adjusted the with appropriately, but the text alignment is off. I'd like the first line "CASE STUDY" to be centered and the body to be left justified and span the width of the box.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.