Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Thanked 0 Times in 0 Posts

    CSS Question on newly discover Syntax

    .container_12 .grid_4,
    1) I notice there is no comma after _12 to ask what is the meaning of this since the comma is after -4,?

    Normally, I would see .grid_4, .grid_6, .grid_12 to know they are individually assigned {float: left; margin:
    4px;}. I try searching to get an understanding of two dot variable with no comma in 1) above to ask? Could not
    copy the code from viewer to thus type a not too exact facismile to wonder and to ask for some fine points help to
    be aware of. I have read some css book, etc but I cannot recall coming across something like 1) above.

    Thanks in advance for taking the time to educate me and deeply appreciated.

    css sheet1
    #header { margin: 0.8em;}

    css sheet2
    .grid_4, .grid_6<b>,</b> .grid_12 {float: left; margin: 4px;}
    <b>.container_12 .grid_4,</b> .container_16 .grid_6 {width: 700px;}

    Html coding with usage of the style sheet
    &lt;div id="header" class="grid_12"&gt;
    &lt;!-- TITLE &amp; BLOCKS --&gt;
    &lt;div id=...
    Last edited by scrtmtl; 02-23-2011 at 11:48 PM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Thanked 656 Times in 655 Posts
    When selectors are separated by commas they share the same rules. .grid_4, .grid_6, .grid_12 will have the same rules like text color and size. It saves space to do things this way.

    .container_12 .grid_4 is different. Here the rules for .grid_4 only apply when it is contained within something with the .container_12 id. It ( .grid_4) may have a different set of rules when inside of a different container.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts