1 Reply Latest reply on Mar 9, 2011 4:36 AM by Nuwan,Chamara

    Nested style name in CSS

    Flex Rock Level 1

      Hi,

          Is there any possibility of having nested style name in a css.

       

           For example stylename '.A' is parent .

           Can we have '.A.B','.A.C' like this. Is it possible, if so please can you give me a sample.

       

      Thanks,

      Jayagopal.

        • 1. Re: Nested style name in CSS
          Nuwan,Chamara

          Hi,

           

          If you want to apply multiple style to a component you can do it like this.

           

          First declaring the styles in the styles tag.

           

          <fx:Style>

          @namespace s "library://ns.adobe.com/flex/spark";

          @namespace mx "library://ns.adobe.com/flex/mx";

           

          .testStyle{

          font-size: 36;

          }

          .testStyle2{

          font-weight:normal;

          font-style:italic;

          }

          </fx:Style>

           

          And use both styles in the component by seperating the style names using a space.

           

          <s:Label text="Testing" styleName="testStyle testStyle2"/>