FireBrick Custom CSS: Difference between revisions
Appearance
Content deleted Content added
m Wording |
m Headers added |
||
| Line 42: | Line 42: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
== Internal inline CSS - using data URIs == |
|||
| ⚫ | |||
| ⚫ | |||
<syntaxhighlight><http css-url="data:text/css,@media screen{div.main,div.sidemenu div.menu a{font-size:x-small}}" /> |
<syntaxhighlight><http css-url="data:text/css,@media screen{div.main,div.sidemenu div.menu a{font-size:x-small}}" /> |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=== 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. 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, a line-break has been added for readability. This must be removed and the whole string entered as a single line. |
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. 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, a line-break has been added for readability. This must be removed and the whole string entered as a single line. |
||