@charset vs. link charset

 

An @charset encoding declaration for a stylesheet takes precedence over a charset attribute in a link element.

This test is only valid if the user agent recognises the @charset and charset attribute declarations.

The HTML page is served as ISO 8859-1 and has a class name ýäè. This only matches the sequence of bytes in the selector of the CSS file if the selector is read as ISO 8859-1. The style sheet has an @charset rule that says the file is ISO 8859-1, but the HTML link charset attribute says UTF-8. If the @charset overrides the charset attribute, the selector will match the class name and the test will pass.

Text as read from the style sheet:   (if blank, the style sheet hasn't been read at all)

Next test
HTML5

css21-style-sheet-rep-019
Result summary & related tests
Detailed results for this test
Link to spec