I answered there too
The previous answer is correct for the CSS rule but the selector must be more specific for a gitbook() format. This a matter of CSS specificity.
Using a browser inspector, you can get a sense of the selector you need to use to override default CSS style set by gitbook.
This simple css will replace background and add a border
.book .book-body .page-wrapper .page-inner section.normal pre {
background: #fff;
border: 1px solid #ddd;
border-color: #000;
}
You put in as you do in style.css and use the css argument of bookdown::gitbook in index.Rmd or in _output.ymldepending of which you are using.
This will pick up the CSS.
I think you could also use !important to have the most specify on pre with
pre {
background: #fff !important;
border: 1px solid #ddd !important;
border-color: #000 !important;
}