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
→‎Base64-encoded data: line breaks - wording
m (Example split off, for greater visibility)
m (→‎Base64-encoded data: line breaks - wording)
 
=== Base64-encoded data ===
You may use base64-encoded data: URIs for safety and complete flexibility, as you will otherwise have to be aware of the risk of your inline CSS containing characters that are either prohibited in data URIs, illegal in quoted strings or in XML attributes. Just some examples are ", %, &, >, newlines and probably various others, but base64-encoding removes this problem completely. IfNote youthe arepresence usingof anythe non-ASCIIcomma charactersafter inthe your CSS, you should use Unicode text and first UTF-8-encode your text into a byte stream, before thenkeyword base64-encoding those bytes. YouThis ''must''is then also declare that your original CSS text was UTF-8 asessential in thea exampledata below. In the following exampleURI, aeven line-breakif hasbase64 been added for readability. This must be removed and the whole string entered as ais singlenot lineused.
 
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, before then base64-encoding those bytes. You ''must'' then also declare that your original CSS text was UTF-8 as in the example below. In the following example, line-breaks may be included for readability. These must be removed and the whole string must be entered as a single line.
<syntaxhighlight>css-url="data:text/css;charset=UTF-8;base64,QG1lZGlhIHNjcmVlbntkaXYubWFpbixkaXYuc2lkZW1lbnUg
 
ZGl2Lm1lbnUgYXtmb250LXNpemU6eC1zbWFsbH19"
<syntaxhighlight>css-url="data:text/css;charset=UTF-8;base64,QG1lZGlhIHNjcmVlbntkaXYubWFpbixkaXYuc2lkZW1lbnUgQG1lZGlhIHNjcmVlbntka
XYubWFpbixkaXYuc2lkZW1lbnUgZGl2Lm1lbnUgYXtmb250LXNpemU6eC1zbWFsbH19"
</syntaxhighlight>
[[Category:FireBrick|Custom]]
252

edits