generalize CSS handling from EpubFormatter into HtmlFormatter