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
div.main, div.sidemenu div.menu a, div.topmenu, textarea
{
font-size: x -small
}
div.footer, div.footer *
{
vertical-align: top;
padding-top: 2px;
padding-bottom: 1px
}
}
</syntaxhighlight>
 
This simple example has certain defects: The vertical layout of the text within the footer is slightly off, for one. The layout of the ‘Graphs’ page is quite a mess, so further work is needed.
 
Note that there is no space after the dot in <code>div.main</code> etc. This is essential; adding white space at this point would alter the meaning - see CSS selectors.
I recommend that you should not attempt to include newlines in the inline CSS of your data URI, as this may be forbidden by the URI scheme standard. 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. See both the RFC for the data URI scheme and also the XML standards. Just some examples of illegal characters are ", %, &, >, newlines and there are probably various others, The simple technique of including literal CSS straight, as below, is only usable if the particular fragment of CSS does not contain any problematic characters, otherwise see the next section for a general method.
 
Example, straight inline CSS (exercise caution regarding prohibited characters if adapting):. 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 lang=xml><http css-url="data:text/css,@media screen{div.main,div.sidemenu div.menu a,div.topmenu,textarea{font-size:x-small}div.footer,div.footer *{vertical-align:top;padding-top:2px;padding-bottom:1px}}" />
</syntaxhighlight>
 
If you are using any non-ASCII characters in your CSS text, unless you have already CSS backslash-hex-encoded them, which avoids the issue, your CSS should be Unicode text and you must first UTF-8-encode your CSS 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,QG1lZGlhIHNjcmVlbntka
css-url="data:text/css;charset=UTF-8;base64,QG1lZGlhIHNjcmVlbntkaXYubWFpbixkaXYuc2
XYubWFpbixkaXYuc2lkZW1lbnUgZGl2Lm1lbnUgYXtmb250LXNpemU6eC1zbWFsbH19"
lkZW1lbnUgZGl2Lm1lbnUgYSxkaXYudG9wbWVudSx0ZXh0YXJlYXtmb250LXNpemU6eC1zbWFsbH1ka
XYuZm9vdGVyLGRpdi5mb290ZXIgKnt2ZXJ0aWNhbC1hbGlnbjp0b3A7cGFkZGluZy10b3A6MnB4O3BhZ
GRpbmctYm90dG9tOjFweH19"
</syntaxhighlight>
 
252

edits