Hi Marcelo -

using this method
#header, #branding {
    border: 1px solid red;
}
you will assign both div's the css properties specified. (in this case 
both div's will have a solid red 1px border)


However if you use this method:
#header {
    border: 1px solid red;
}
#branding {
    border: 1px solid black;
}
Then both div's will have a solid 1px border; one will be red, the other 
black. 

Using this method:
#header #branding {
    border: 1px solid red;
}
you will assign a 1px solid red border to any div whose id is branding, 
AND is contained within the div header.  ie - if you have more than one 
branding div then the CSS rule will only be applied if the branding div 
is contained inside the header.

Hopefully this clears things up a bit.

Regards -
Travis Killen
http://www.936webdesign.com


Marcelo de Moraes Serpa wrote:
> Hello!
>
> I'm just starting with CSS (currently reading CSS Mastery, quite good book
> btw :)) and got stuck on the following:
>
> Let's say I've got a header div and a branding div. The branding div is a
> "child" of header (it will hold a logo of the website). Currently, I'm 
> doing
> this the following way:
>
> <div id="header">
> <div id="branding"></div>
> </div>
>
> CSS:
>
> #header { ... }
> #branding {...}
>
> However, I've saw many css scripts using cascading with id. Would it make
> any difference to do this way: #header #branding { ... } ?
>
> (I can't test it right now)
>
> Thanks in advance!
>
> Marcelo.
> ______________________________________________________________________
> css-discuss [EMAIL PROTECTED]
> http://www.css-discuss.org/mailman/listinfo/css-d
> IE7 information -- http://css-discuss.incutio.com/?page=IE7
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to