HighDots Forums  

CSS: Basic question concerning selectors/definitions...

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss CSS: Basic question concerning selectors/definitions... in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rbaulbin@hotmail.com
 
Posts: n/a

Default CSS: Basic question concerning selectors/definitions... - 02-06-2008 , 05:35 PM






Hello -

Is there any advantage to defining classes with the element name vs.
without the element name?

p.center {properties...}
vs.
..center {same properties...}

I mean, if both above can be used for the "p" element, why do people
include the p in the definition?

Thanks,

RB

Reply With Quote
  #2  
Old   
Rik Wasmus
 
Posts: n/a

Default Re: CSS: Basic question concerning selectors/definitions... - 02-06-2008 , 07:39 PM






On Thu, 07 Feb 2008 00:35:19 +0100, <rbaulbin (AT) hotmail (DOT) com> wrote:

Quote:
Hello -

Is there any advantage to defining classes with the element name vs.
without the element name?

p.center {properties...}
vs.
.center {same properties...}

I mean, if both above can be used for the "p" element, why do people
include the p in the definition?
Because for instance ul.center should be displayed different / has other
values then p.center?
--
Rik Wasmus


Reply With Quote
  #3  
Old   
rbaulbin@hotmail.com
 
Posts: n/a

Default Re: CSS: Basic question concerning selectors/definitions... - 02-06-2008 , 10:02 PM



On Feb 6, 8:39 pm, "Rik Wasmus" <luiheidsgoe... (AT) hotmail (DOT) com> wrote:
Quote:
On Thu, 07 Feb 2008 00:35:19 +0100, <rbaul... (AT) hotmail (DOT) com> wrote:
Hello -

Is there any advantage to defining classes with the element name vs.
without the element name?

p.center {properties...}
vs.
.center {same properties...}

I mean, if both above can be used for the "p" element, why do people
include the p in the definition?

Because for instance ul.center should be displayed different / has other
values then p.center?
--
Rik Wasmus
So, with the example above, if .center contained additional properties
than p.center, then the additional properties in .center would be
taken on by p.center (added to the properties in p.center)?

RB


Reply With Quote
  #4  
Old   
Rik Wasmus
 
Posts: n/a

Default Re: CSS: Basic question concerning selectors/definitions... - 02-07-2008 , 03:37 AM



On Thu, 07 Feb 2008 05:02:42 +0100, <rbaulbin (AT) hotmail (DOT) com> wrote:

Quote:
On Feb 6, 8:39 pm, "Rik Wasmus" <luiheidsgoe... (AT) hotmail (DOT) com> wrote:
On Thu, 07 Feb 2008 00:35:19 +0100, <rbaul... (AT) hotmail (DOT) com> wrote:
Hello -

Is there any advantage to defining classes with the element name vs.
without the element name?

p.center {properties...}
vs.
.center {same properties...}

I mean, if both above can be used for the "p" element, why do people
include the p in the definition?

Because for instance ul.center should be displayed different / has other
values then p.center?

So, with the example above, if .center contained additional properties
than p.center, then the additional properties in .center would be
taken on by p.center (added to the properties in p.center)?

Yes, unless they contradict each other, in which case the rule in p.center
wins as it's more specific.
--
Rik Wasmus


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.