12/12/2007

CSS IE hacks

* html #content {} is accepted by IE, but other browsers ignore them.
html>body #content is accepted by other browsers, but gets ignored by IE.
IE has a bug called Box Model problem. http://css-discuss.incutio.com/?page=BoxModelHack
* html div
{
width: 140px; /* all accept this */
w\idth: 100px; /* Only IE 6 accepts */
}

12/03/2007

There is another selector called Descendant Selectors

Descendant Selectors

We can specify the style of an element only when it is inside another element. To accomplish this, we use the concept of descendant selectors.

The syntax for declaring a descendant selector is:

[Parent Selector] [Child Selector] {
property:value;
...
}

The style defined above will apply to child selectors only when they are inside the parent selector. Such declarations can go on for more than two levels.

For example, in the declaration below,

li b {
color:yellow;
}

means that text in the element inside the
  • element will be yellow. Text in the elements not within the
  • element will not be affected by this stylesheet.