cascading style sheets

Because of the xhtml class in ceegeye it is now possible to use a css file for formatting. This can be linked to the current cgi output by supplying a file path for a css file in the pagebegin function of the xhtml class, e.g.

p.pagebegin("title", "", "/css/format.css");

The file is a path off of document_root. i.e. for the above path to work if the document root of the web server is /var/www/html the full path to the css file would be /var/www/html/css/format.css
Alternatively if you wish to have the style as part of the head tag of the document you can do this:

std::string style("<style type=\"text/css\""\n"
                  "  body { color:#1111FF; }\n"
                  "</style>\n");
p.pagebegin("title", style);

This is obviously a little unreadable, it puts this in the head of the document:

<style type="text/css">
  body { color:#1111FF; }
</style>

This will change the body text to be a lightish blue. Obviously this is a simple example & adding any valid css is okay here. It maybe easier to use the first type of css i.e. an external file as you don’t have to worry about escaping characters, new lines etc.

css specification:- W3.org css
All things Markup:- W3.org