CSS Hacks

This page contains some plausible (but untested!) CSS code to transform HTML tags. Some other markup (e.g., for lists and whitespace management) will require JavaScript help to rewrite the HTML.

// fonts
b:before  { content: "B^";}
em:before { content: "E^";}
i:before  { content: "I^";}
tt:before { content: "T^";}
b:after, em:after, i:after, tt:after { content: "^"; }

// headers
h1, h2, h3, h4, h5, h6 { font-style: normal; }
h1:before { content: "H1^ "; }
h2:before { content: "H2^ "; }
h3:before { content: "H3^ "; }
h4:before { content: "H4^ "; }
h5:before { content: "H5^ "; }
h6:before { content: "H6^ "; }

// images
img:before { content: "BI^"; }
img:after  { content: "EI^"; }

// preformatted text
pre:before { content: "BP^"; }
pre:after  { content: "EP^"; }

// quoted text
blockquote:before { content: "BQ^"; }
blockquote:after  { content: "EQ^"; }


This wiki page is maintained by Rich Morin, an independent consultant specializing in software design, development, and documentation. Please feel free to email comments, inquiries, suggestions, etc!

Topic revision: r3 - 27 Mar 2016, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email