針對特定網站設立樣式
出自 MozTW Wiki
Mozilla Firefox 1.5 有新增了一個 CSS 功能允許使用者為特定網站設立自訂樣式。blah blah
編輯自訂樣式檔
CSS 語法
以下內容取自 http://lists.w3.org/Archives/Public/www-style/2004Aug/0135.html
The syntax that I've implemented is the addition of an @-moz-document rule that works like an @media rule and has the syntax (in some reasonably typical notation):
docrule ::= "@-moz-document" S+ url-list "{" S* ruleset* "}"
url-list ::= url-item ( "," S* url-item )*
url-item ::= ( "url(" | "url-prefix(" | "domain(" ) URL ")" S*
where S is from the CSS2 tokenization, ruleset is from the CSS2 grammar, and URL is like the production URI in the CSS2 tokenization except without the 'url(' and ')'.
To define the three functions by example:
@-moz-document url(http://www.w3.org/), url-prefix(http://www.w3.org/Style/), domain(moztw.org) { /* 這裡的 CSS 規則會套用到 + "http://www.w3.org/" 頁面 + 任何位址以 "http://www.w3.org/Style/" 為開頭的頁面 + 任何位址主機是 "moztw.org" 或以 ".moztw.org" 為結尾的頁面 */ }