When you publish a book, the topic template names are included in the output files. These names can be used to identify a topic to then use css to apply borders or shading to the topic content. For example, you may have topics based on the Reference template. You can include css definitions to add a black border and grey shading to the topic heading and content for all topics using this template.
As this is concerning topic content customization, the appropriate code should be added to the contentstyles.css in your theme folder.