Jump to content

This is the support site for Andrews & Arnold Ltd, a UK Internet provider. Information on these pages is generally for our customers but may be useful to others, enjoy!

FireBrick Custom CSS: Difference between revisions

m
Wording
(Added example data uri including base64)
m (Wording)
</syntaxhighlight>
 
To avoid having to use an external website, you can employ a "data:" uri. ThereBe aware that there may be a limit on the length of URIs however. The following example greatly reduces the font sizes in use in the Firebrick's web pages -
 
<syntaxhighlight><http css-url="data:text/css,@media screen{div.main,div.sidemenu div.menu a{font-size:x-small}}" />
</syntaxhighlight>
 
You canmay use base64-encoded data: URIs for safety and complete flexibility, as you will otherwise have to be aware of the risk of theyour inline CSS containing characters that are either prohibited in data: URIs, or illegal in quoted strings or in XML attributes. Just some examples are ", %, &, >, newlines and probably various others, but base64-encoding removes this problem completely. If you are using any non-ASCII characters in your CSS, you should use Unicode text and first UTF-8-encode your text into a byte stream, andbefore then base64-encodeencoding those bytes. You ''must'' then also declare that your original CSS text was UTF-8 as in the example below. In the following example, a line-break has been added for readability. This must be removed and the whole string entered as a single line.
 
<syntaxhighlight>css-url="data:text/css;charset=UTF-8;base64,QG1lZGlhIHNjcmVlbntkaXYubWFpbixkaXYuc2lkZW1lbnUg
252

edits