Reply to Re: CSS: Class error

Your name:

Reply:


Posted by Michael Winter on 02/26/06 16:06

On 26/02/2006 09:21, Els wrote:

[snip]

> (If I understood appendix B of the CSS1 specs correctly (of which I'm
> not sure), only 1 class/id/pseudo-class is allowed per selector in
> CSS1)

I'm not quite sure what you're trying to express, here.

.className or #id

but not

#id.className

An id, class, or pseudo-class selector can appear by itself [optionally
combined with an element], but more than one type of attribute selector
cannot be combined.

Or perhaps:

#id.className

but not

.class1.class2

Multiple attribute selector types can be used together, but only one of
each type can be used at once.

As I read it, the grammar permits the latter, but it also places very
tight constraints on the /order/ of simple selector components: element,
id, class, pseudo-class. A simple selector can contain any of these, but
if any are present, they must appear in that order and can only occur
once at most.

The reason why

.subsubsection#sverige a

fails is because the id selector follows the class name.

#sverige.subsubsection a

will be accepted.

Note that the W3C validator doesn't care much for the order, either
because it wasn't meant to be significant (but that fact couldn't be
expressed concisely in the grammar), or due to a bug.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация