savannah-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers] web stylesheets for XHTML


From: Chris Hanson
Subject: [Savannah-hackers] web stylesheets for XHTML
Date: Wed, 27 Nov 2002 14:35:14 -0500
User-agent: IMAIL/1.19; Edwin/3.113; MIT-Scheme/7.7.2.pre

   Date: 27 Nov 2002 20:09:02 +0000
   From: Mathieu Roy <address@hidden>

   I'm fine with this but I wonder why it's problematic with XHTML.

Browsers aren't required to recognize upper-case element names in
style sheets when processing XHTML, although in practice most do.
However, if the document is processed as XML rather than as XHTML, the
XML processor is _required_ to treat the element names as case
sensitive.

   CSS is a standard used by html and xhtml. XHTML specs does not
   override CSS specs. And all savannah CSS pages are standard
   compliants (normally).

The CSS spec doesn't define the case sensitivity of the element names,
but defers that definition to the language in which the style sheet is
embedded:

----------------------------------------------------------------------
4.1.3 Characters and case

The following rules always hold:

   * All CSS style sheets are case-insensitive, except for parts that are
     not under the control of CSS. For example, the case-sensitivity of
     values of the HTML attributes "id" and "class", of font names, and of
     URIs lies outside the scope of this specification. Note in particular
     that element names are case-insensitive in HTML, but case-sensitive in
     XML.
----------------------------------------------------------------------

According to the XHTML 1.0 spec, it's recommended that lower case be
used:

----------------------------------------------------------------------
C.13. Cascading Style Sheets (CSS) and XHTML

The Cascading Style Sheets level 2 Recommendation [CSS2 [p.31] ]
defines style properties which are applied to the parse tree of the
HTML or XML documents. Differences in parsing will produce different
visual or aural results, depending on the selectors used. The
following hints will reduce this effect for documents which are served
without modification as both media types:

1. CSS style sheets for XHTML should use lower case element and
   attribute names.
----------------------------------------------------------------------

Is this a convincing argument?  :)

Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]