Re: [WSG] Question of CSS specificity

2006-03-06 Thread Paul Novitski



Barrie North wrote:

I need some help, what is the difference between:

table.module


At 07:45 PM 3/5/2006, Lachlan Hunt wrote:


Specificity: 0,0,1,1



To see where Lachlan is getting these numbers, read:

6.4.3 Calculating a selector's specificity
http://www.w3.org/TR/CSS21/cascade.html#specificity

Both that page (6 Assigning property values, Cascading, and 
Inheritance) and the previous one (5 Selectors) make for pretty 
interesting reading.  I think everyone working with CSS should read 
the whole spec at least once.  I refer back to it once or twice a 
week to refresh my memory on specific points.


Cascading Style Sheets, level 2 revision 1
CSS 2.1 Specification
http://www.w3.org/TR/CSS21/

Regards,
Paul 


**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**



Re: [WSG] Question of CSS specificity

2006-03-05 Thread Ben Buchanan
.module will apply to any element with class=module, table.module
will only apply to table elements.

That's about it :) No doubt there's some deeper meaning that I've not
yet heard, of course... ;)

--
--- http://www.200ok.com.au/
--- The future has arrived; it's just not
--- evenly distributed. - William Gibson
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: [WSG] Question of CSS specificity

2006-03-05 Thread Samuel Richardson
table.module will only apply the style to a table with class=module on 
it. .module will apply the style regardless of what element the class is on.


a.contentpagetitle:link will apply the style to any a tags with a 
.contentpagetitle class on them that is a link. .contentpagetitle a:link 
will apply the style to any elements INSIDE .contentpagetitle that are a 
link.



Barrie North wrote:

Hi all,
 
I need some help, what is the difference between:
 
table.module

and
.module
 
Is table.module just more specific or is there more going on?
 
Similar question between:


a.contentpagetitle:link
and
.contentpagetitle a:link

Thanks in advance,
 
Barrie North

www.compassdesigns.net http://www.compassdesigns.net/
www.joomlashack.com http://www.joomlashack.com/
(802) 428-4146
Skype:compassdesign
~Professional Joomla Web Design~

**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**



Re: [WSG] Question of CSS specificity

2006-03-05 Thread Lachlan Hunt

Barrie North wrote:

I need some help, what is the difference between:
 
table.module


Specificity: 0,0,1,1


and
.module


Specificity: 0,0,1,0


Is table.module just more specific or is there more going on?


The former will only select tables with the class name module.  The 
latter will select any element with the class name module.


e.g.
table class=module
p class=module
div class=module
em class=module

They will all be selected by .module, but only the table will be 
selected by table.module



Similar question between:
a.contentpagetitle:link


Specificity: 0,0,2,1

That will select
a href=# class=contentpagetitlelink/a


and
.contentpagetitle a:link


Specificity is the same, but will select differently:

p class=contentpagetitle
  a href=#link/a
/p

(The p element could be any ancestor element)

--
Lachlan Hunt
http://lachy.id.au/
**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**