This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > May 2005 > Hierarchy in styles





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Hierarchy in styles
Rob Nicholson

2005-05-26, 7:44 am

I came across the following format of style sheets:

..Label .TextBox .DropDown .Title1 .FormButton .TabHeading
{
font-family: Verdana, Helvetica, sans-serif;
}

..Label
{
font-size: 10pt;
line-height: 22px;
}

I thought this means that .Label ends up with a style including the original
font-family plus the font-size and line-height. This doesn't appear to work
on IE6, i.e. it ignores the font-family and doesn't build a hierarchy. You
have to include the font-family within the second .Label style.

Have I misunderstood the specification somewhere?

Cheers, Rob.


Spartanicus

2005-05-26, 7:44 am

"Rob Nicholson" <rob.nicholson@nospam_informed-direct.com> wrote:

>.Label .TextBox .DropDown .Title1 .FormButton .TabHeading


Spaces such as used here are descendant selectors:
http://www.w3.org/TR/CSS21/selector...ndant-selectors

Insert commas to apply a style to several classes.

--
Spartanicus
Harlan Messinger

2005-05-26, 7:38 pm

Rob Nicholson wrote:
> I came across the following format of style sheets:
>
> .Label .TextBox .DropDown .Title1 .FormButton .TabHeading
> [snip]
> I thought this means that .Label ends up with a style including the original
> font-family plus the font-size and line-height. This doesn't appear to work
> on IE6, i.e. it ignores the font-family and doesn't build a hierarchy. You
> have to include the font-family within the second .Label style.


Your selector above matches only an element with a class of TabHeading
that is in an element of class FormButton that is in an element of class
Title1 that is in an element of class Dropdown that is in an element of
class TextBox that is in an element of class Label. You want

.Label, .TextBox, .DropDown, .Title1, .FormButton, .TabHeading

and then you'll get the result you were expecting.
Harlan Messinger

2005-05-29, 11:24 pm


Rob Nicholson wrote:
> I came across the following format of style sheets:
>
> .Label .TextBox .DropDown .Title1 .FormButton .TabHeading
> [snip]
> I thought this means that .Label ends up with a style including the original
> font-family plus the font-size and line-height. This doesn't appear to work
> on IE6, i.e. it ignores the font-family and doesn't build a hierarchy. You
> have to include the font-family within the second .Label style.


Your selector above matches only an element with a class of TabHeading
that is in an element of class FormButton that is in an element of class
Title1 that is in an element of class Dropdown that is in an element of
class TextBox that is in an element of class Label. You want

.Label, .TextBox, .DropDown, .Title1, .FormButton, .TabHeading

and then you'll get the result you were expecting.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews