Docbook - Set Cascading Style Sheets(css) path in your html file

By xngo on June 18, 2019

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
  <xsl:import href="lib/docbook-xsl/html/docbook.xsl"/>
 
  <!--
    The path of the Cascading Style Sheets(css) that will be set in 
        the <link> tag of your HTML output file.
  -->
  <xsl:param name="html.stylesheet">css/doc.style.css</xsl:param>
 
</xsl:stylesheet>

doc.style.css example

@CHARSET "UTF-8";
/* Each chapter separated by a long rectangle bar. */
div.chapter > div.titlepage
{
    background-color: rgb(235, 235, 235);
}
/* --- */
 
/* Indent section */
div.section
{
    margin-left: 10px;
}
/* --- */
 
.guilabel
{
  font-weight: bold;
}
 
/* Make it looks like a button. */
.guibutton
{
    border: 2px outset #dddddd;
    background-color: #dddddd;
}
/* --- */
 
/* Table with fine straight lines. */
table {
  background-color:#FFF;
  border-collapse:collapse;
}
 
td, th {
  border: 1px solid black;
  padding: 5px;
}
 
th{ 
  background-color: rgb(235, 235, 235); 
  text-align: center;
}
/* --- */

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.