Prev | Current Page 586 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

Although
it supports application/xml and text/xml, it??™ll treat the document as generic XML
rather than XHTML. This is why most authors serve their XHTML markup as
text/html, yet few realize that this causes browsers to handle their pages as HTML,
rather than XHTML.
Serving XHTML as text/html is permitted by the W3C, provided that the markup
complies with the guidelines in Appendix C of the XHTML 1.0 specification.5
5 http://www.w3.org/TR/xhtml1/#guidelines
Differences Between HTML
and XHTML
The Ultimate CSS Reference 412
Case Sensitivity
CSS is case insensitive in all matters under its control; however, some things, such
as the document markup language, are beyond its control. HTML is case insensitive
in most respects, except when it comes to certain attribute values, like the id and
class attributes. XHTML, being XML, is always case sensitive.
This means that the CSS element type selectors (p. 62) for an HTML document are
case insensitive, though they??™re case sensitive for XHTML, as this example shows:6
h1 {
font-size: 150%;
}
H1 {
color: red;
}
The first rule will apply to all level-one headings in HTML (even if the tags are
written as

??¦

in HTML) and XHTML.


Pages:
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598