Re: Cascading HTML style sheets -- a proposal

Bert Bos (bert@let.rug.nl)
Mon, 17 Oct 1994 14:26:06 +0100 (MET)


Dave Raggett writes:

|Bert Bos writes:
|
|> Elements in HTML can have attributes that influence the lay-out, such
|> as <OL COMPACT> or <P ALIGN=LEFT>. The best way would be to remove
|> those attributes from HTML. If necessary, we could introduce new GI's
|> instead of those attributes that also have a semantic function, as in
|> the case of <UL WRAP=VERT>
|
|Such attributes play a useful role in HTML as they express the intentions
|of authors for particular elements, and can provide the basis for more
|sophistocated style sheet mechanisms that exploit richer markup. What is
|needed is a way of mapping such attributes into style sheet statements.
|A further advantage of these attributes is that they allow you to use
|generic style sheets which can be cached effectively. Any overrides on a
|per element basis are handled via the attribute values and mapping rules

Agreed. Two comments:

1. I stated what I think should be the general principle in
further developing both HTML and HTML style sheets (HSSL?):

A. semantic & structural information -> HTML
B. lay out information -> HSSL
C. inseparable information -> ????

Things like <UL WRAP=VERT>, <UL PLAIN>, <TABLE BORDER>, <CAPTION
ALIGN=TOP>, <H1 ALIGN=CENTER>, <P NOWRAP>, etc. should be carefully
analyzed to see if they belong in HTML. For example, I would classify
the above as follows:

keep in HTML: remove to HSSL:
------------- ---------------
UL WRAP=VERT TABLE BORDER
UL PLAIN CAPTION ALIGN=TOP
P NOWRAP H1 ALIGN=CENTER

NB1. <RENDER> should definitely stay in HTML, but I have some doubts
about <HR>.

NB2. For an example of how *not* to do it, look at MCOM-Netscape
(pronounced `Mozilla' :-).

2. Combined with what I wrote earlier about using both GIs and IDs to
refer to elements, we now need a syntax for:

1. an ID alone
2. a GI alone
3. a GI plus one or more attribute/value pairs
4. (?) one or more attribute/value pairs without a GI

For example:

ul.above: 12pt # Default for all UL elements
ul[wrap=vert][plain].above: 10pt
ul[plain].above: 5pt # For other <UL PLAIN> elements

or, since a GI can also be viewed as an attribute:

baseline
GI=UL
WRAP=VERT : 12pt
border ID=p-12 : double
font.size NOWRAP NOFOLD : 10pt

(Some disambiguating rule is necessary as well.)

Bert

PS. Shouldn't this discussion be moved to www-html?

-- 
___________________________________________________________________________
####[ Bert Bos                     ]####[ Alfa-informatica,           ]####
####[ <bert@let.rug.nl>            ]####[ Rijksuniversiteit Groningen ]####
####[ http://www.let.rug.nl/~bert/ ]####[ Postbus 716                 ]####
####[                              ]####[ NL-9700 AS GRONINGEN        ]####
####[______________________________]####[_____________________________]####