[Top]
More advice for the full screen mode.
   
Sivut toimivat riittävän hyvin MS IE 4.0+, Opera 5.x+, Netscape 6.0+/ vast. Mozilla ja Konqueror 3.x selaimilla. Yleisesti ottaen sivut toimivat parhaiten uusimmilla Opera selaimilla. Sivujen toimivuus vanhemmissa selaimissa on heikko, erityisesti Netscape 4.x kohdalla.

I list below all topic groups, which I have done according to subjects, which they handle. You can return to this topic group by using this menu and the link Table of topic groups on the top of the each page.
 
 
Search:
[Help]

Id selector

In order to separate it from other identifiers, the name is in the element inside the attribute id. In CSS-encoding it use the character #. It can be immediately connected to other selectors without a dot. If it is connected to the universal selector, the format is *#some-id. This is however unnecessary, because they don't need explicit to connect any element type selector. At this matter they work like attribute selectors. An example of using id What are selectors, classes and id-attributes ([M][S][Pw]):

<HEAD>
<TITLE>
The id selector match only to element H1</TITLE>
<STYLE type="text/css">
h1#z98y {letter-spacing: 0.5em } /* remark the # sign, which express that this is an id selector; It doesn't use a dot; If you put a space, you get an another rule */
</STYLE>
</HEAD>
<BODY>
<H1 id="z98y">
Wide text</H1>
</BODY>

Id-selectors have higher weight than than attribute selectors. Then for example #p123 {...} is more specified than [id="p123"] {..} even if they match to the same place in the body of the document like <P id="p123">) like style="color:#660033; background-color:yellow;". This matter have any meaning today, but thinking about future, this is worth to keep in mind (look another example from the error page[S][Pw]).

Even if style-attributes don't have actual rules (they have only individual declarations and a single declaration-block), they create in the processing logical rules, which correspond the weight of them. According to CSS1 specification id-selectors have the same weight as declarations, which are inside style-attributes:

A declaration in the STYLE attribute of an element (...) has the same weight as a declaration with an ID-based selector that is specified at the end of the style sheet.

The CSS2 specification says (6.4.3 Calculating a selector's specificity), that they are considered to be after all other rules. This not a matter of weight but the cascading order[S], which I handle later.

Browser-specific notes:.

  1. The same kind of identification method is used also other than CSS-definitions, which might cause confusions for the author. Java-scripts use them also. It is however possible to use the same id attribute both with CSS and JavaScript encoding - to the latter the values of id attributes must be unique!

  2. The same id attribute for CSS and JavaScript doesn't normally cause any trouble to the UA, because they are interpreted with different interpreters. I got however an e-mail, where I was told that to use same id with CSS and scripts might cause problems in MS IE 4.x for Windows. I have created some advice how to use the id attribute in the page Help for HTML All menu[S].

  3. Id-selectors can be used in XML-documents. Because XML-documents don't need to use any specific DTD-files (or the browser don't always read them), rules like #id {} don't necessary work in XML-documents . Look at also another note[S]. and the first paragraph[S], where I handle attribute selectors.

[Top]