Nesting (?) CSS

Discussion in 'HTML' started by rsimpson505@gmail.com, Nov 2, 2005.

  1. Guest

    Probably I have missed something, but how do you use one style
    definition inside another?
    For example:
    I want to define two styles of <td> tags, td1 td2, which share some
    properties from style tdg and have some individual properties:

    td.tdg {
    width: 30;
    height: 50;
    border-left: solid 1px gray;
    border-top: solid 1px gray
    }
    td.td1 {
    <!-- want to use td.tdg definition here -->
    border-right: solid 1px gray;
    border-bottom: solid 1px gray
    }
    td.td2 {
    <!-- want to use td.tdg definition here -->
    border-right: solid 1px gray;
    border-bottom: solid 2px navy
    }

    How do I do this?

    PS Do you call this cascading, nesting, including - or something else?
    , Nov 2, 2005
    #1
    1. Advertising

  2. Steve Pugh Guest

    wrote:
    > Probably I have missed something, but how do you use one style
    > definition inside another?


    You don't.

    > I want to define two styles of <td> tags, td1 td2, which share some
    > properties from style tdg and have some individual properties:


    td.tdg, td.td1, td.td2 { common styles }
    td.td1 { unique styles }
    td.td2 { unique styles }

    > PS Do you call this cascading, nesting, including - or something else?


    As it doesn't exist in CSS terms it isn't called anything at all.

    Steve
    Steve Pugh, Nov 2, 2005
    #2
    1. Advertising

  3. Guest

    Thanks Steve,
    That's clear - and it works.
    R

    Steve Pugh wrote:

    > wrote:
    > > Probably I have missed something, but how do you use one style
    > > definition inside another?

    >
    > You don't.
    >
    > > I want to define two styles of <td> tags, td1 td2, which share some
    > > properties from style tdg and have some individual properties:

    >
    > td.tdg, td.td1, td.td2 { common styles }
    > td.td1 { unique styles }
    > td.td2 { unique styles }
    >
    > > PS Do you call this cascading, nesting, including - or something else?

    >
    > As it doesn't exist in CSS terms it isn't called anything at all.
    >
    > Steve
    , Nov 2, 2005
    #3
  4. Neredbojias Guest

    With neither quill nor qualm, quothed:

    > Probably I have missed something, but how do you use one style
    > definition inside another?
    > For example:
    > I want to define two styles of <td> tags, td1 td2, which share some
    > properties from style tdg and have some individual properties:
    >
    > td.tdg {
    > width: 30;
    > height: 50;
    > border-left: solid 1px gray;
    > border-top: solid 1px gray
    > }
    > td.td1 {
    > <!-- want to use td.tdg definition here -->
    > border-right: solid 1px gray;
    > border-bottom: solid 1px gray
    > }
    > td.td2 {
    > <!-- want to use td.tdg definition here -->
    > border-right: solid 1px gray;
    > border-bottom: solid 2px navy
    > }
    >
    > How do I do this?


    I think you can just use class="tdg td1" ("tdg td2").

    Try it. If not -

    Change "td.td1" to "td.tdg td.td1,td.tdg td.td2". Then: class="tdg
    td1" (or "tdg td2") in the tds.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Nov 2, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DeadlyTedly
    Replies:
    2
    Views:
    2,526
    Ted Bradley
    Oct 16, 2003
  2. Edward

    Nesting Datagrids

    Edward, Nov 11, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,323
    Guest
    Nov 11, 2003
  3. John

    Nesting Datagrids

    John, Nov 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    340
  4. Noozer

    CSS nesting...

    Noozer, Aug 10, 2005, in forum: HTML
    Replies:
    3
    Views:
    4,573
  5. Trans
    Replies:
    10
    Views:
    280
    Sean O'Halpin
    Sep 16, 2005
Loading...

Share This Page