This is a great clarification and something that would've stumped me completely if ever encountered.
Thanks, Mike -----Original Message----- From: css-d-boun...@lists.css-discuss.org [mailto:css-d-boun...@lists.css-discuss.org] On Behalf Of Chris Rockwell Sent: Tuesday, October 01, 2013 12:01 PM To: Greg Gamble Cc: CSS-D Subject: Re: [css-d] Two classes, two conflicting rules, which wins ? Greg - I can see how you might think that, but you are thinking along the lines of directly mapping the class to the declaration (e.g. <div class="c1 c2"> === <div style="width:20em;width30em">) which is not the case. The engine decides which style to map based on the cascading order, and only those styles are applied. I hope that helps and I haven't confused things more. On Tue, Oct 1, 2013 at 2:54 PM, Greg Gamble <ggam...@sbctc.edu> wrote: > Wouldn't the first div width = 30em, and the second div width = 20em? > > <DIV id="i1" class="c1 c2">...</DIV> C2 overrides C1 > > <DIV id="i2" class="c2 c1">...</DIV> C1 overrides C2 > > > Greg Gamble > SBCTC - Olympia | Information Services > > > -----Original Message----- > From: css-d-boun...@lists.css-discuss.org [mailto: > css-d-boun...@lists.css-discuss.org] On Behalf Of Chris Rockwell > Sent: Tuesday, October 01, 2013 11:46 AM > To: Philip Taylor > Cc: CSS-D > Subject: Re: [css-d] Two classes, two conflicting rules, which wins ? > > How you assign them in the class attribute has no bearing. > > > On Tue, Oct 1, 2013 at 2:45 PM, Chris Rockwell > <ch...@chrisrockwell.com > >wrote: > > > http://www.w3.org/TR/CSS2/cascade.html#cascading-order > > > > In your example, width is 30em; > > > > > > On Tue, Oct 1, 2013 at 2:40 PM, Philip Taylor <p.tay...@rhul.ac.uk> > wrote: > > > >> Consider : > >> > >> .c1 {width: 20em} > >> .c2 {width: 30em} > >> > >> <DIV id="i1" class="c1 c2">...</DIV> > >> <DIV id="i2" class="c2 c1">...</DIV> > >> > >> What widths do i1 and i2 have, and why ? Answers by reference to > >> the relevant W3C specification(s), please, not by experiment or > >> guesswork ! > >> > >> Philip Taylor > >> > >> > >> ___________________________________________________________________ > >> __ _ css-discuss [css-d@lists.css-discuss.org] > >> http://www.css-discuss.org/mailman/listinfo/css-d > >> List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- > >> http://css-discuss.org/policies.html > >> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > >> > > > > > > > > -- > > Chris Rockwell > > > > > > -- > Chris Rockwell > ______________________________________________________________________ > css-discuss [css-d@lists.css-discuss.org] > http://www.css-discuss.org/mailman/listinfo/css-d > List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- > http://css-discuss.org/policies.html > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > ______________________________________________________________________ > css-discuss [css-d@lists.css-discuss.org] > http://www.css-discuss.org/mailman/listinfo/css-d > List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- > http://css-discuss.org/policies.html > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > -- Chris Rockwell ______________________________________________________________________ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ ______________________________________________________________________ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/