|
|
||||||||||||||||||||||||||
|
Using Stylesheets with HT2HTMLThe HTML generated by HT2HTML contains a lot of style-based markup directly in the document. You can control just how much of this is done by controlling the generator class; the Skeleton class is fairly agressive about controlling the page layout using presentational markup, and tailoring that though subclassing can cause a good deal of duplicated code. Fortunately, support has been added to support using stylesheets with HT2HTML, at least to some degree. Each of the major components of the page is assigned a class attribute that can be used in a stylesheet, with some special treatment for the continuation section. Page Component ClassesEach of the page components is contained in an element which carries a class attribute with the same name as the component is given in the description of the page components. The class names are given in all lower case. The continuation component is treated a little specially since the general expectation is that it's content should be mostly like that of the body. Specifically, it is contained in a pair of elements, the outer having the class body and the inner having the class continuation. This allows a style sheet to set up all the normal body styles using the body class, and speciallize anything that needs to be by using both both in the selector, like this: .body h2 { font-size: 120%; } .body .continuation h4 { font-size: 125%; } One common need is to add a little space between the edge of the browser's canvas (the portion of the display the content actually gets displayed on), and the text which is presented in the continuation area. This is needed since the normal margins are overridden so that the banner and sidebar do not appear to be "floating" on the page. Using a stylesheet, this bit of CSS can be used to add reasonable margins: .continuation { margin-left: 1em; margin-right: 1em; } Generator SupportThe Skeleton generator base class supports two hooks that allow generators to add style information. Each of these takes the form of a method that can be overridden if needed.
|