Publishing Books Using XML Technologies
Dr. Herong Yang, Version 4.01

Assigning CSS Files to Web Pages

This section describes how CSS files are assigned to HTML Web pages.

CSS properties can be defined right inside the HTML element as shown in the following example:

<p style="{text-align: center;}">Show in the middle.</p>

But if you can also put all CSS properties into a file and assign that file to all of your Web pages to be more efficient. hyPub suggests that:

1. Store all CSS properties in a file called _hypub.css.

2. Assign _hypub.css to Web pages inside the "head" element with the "link" element as shown below:

<link rel="stylesheet" type="text/css" href="_hypub.css"/>

Table of Contents

 About This Book

 Ideas on Publishing Books using XML

 Overview of hyPub - A Simple XML Publishing Tool

 Writing Book Contents in XHTML Source Files

 Transforming Book Source Files with XSL Technology

 Designing Web Page Layouts with Tables

Controlling Web Page Appearance with CSS

 What Is CSS?

 Suggested CSS Definitions for Book Web Pages

Assigning CSS Files to Web Pages

 Sharing HTML Codes with JavaScript Files

 Generating Web Pages with hyPub

 Formatting Printable Documents with XSL-FO

 Generating PDF Documents with hyPub

 Areas of Future Improvements


 PDF Printing Version

Dr. Herong Yang, updated in 2007
Assigning CSS Files to Web Pages