代码之家  ›  专栏  ›  技术社区  ›  Mark Ingram

使用css设置样式类

  •  1
  • Mark Ingram  · 技术社区  · 15 年前

    我有下面的css,我想开始工作。我肯定我也做过类似的事情,但我在谷歌上找不到答案。

    基本上,一些样式属性有可以更改的子属性,例如container.borderskin。您可以在borderskin样式上设置borderthicks、borderstyle等。

    <mx:Style>
            .myBorderSkin
            {
                borderThickness: 5;
                borderColor: #FF0000;
                /*borderStyle: none;*/
            }
    
            MyControl
            {
                borderSkin: .myBorderSkin;
            }
    </mx:Style>
    

    不幸的是,当我运行应用程序时,我得到错误“type error:error 1034:type强制失败:无法将“myborderskin”转换为类。”

    1 回复  |  直到 15 年前
        1
  •  0
  •   Mark Ingram    15 年前

    我就是这么想的:

    ButtonBar 
    { 
            buttonStyleName: "buttonBarButton"; 
            firstButtonStyleName: "firstButtonBarButton"; 
            lastButtonStyleName: "lastButtonBarButton";
    }
    
    .buttonBarButton 
    {
            color: #000000;
            textRollOverColor: #000000;
            textSelectedColor:#000000; 
    }
    

    通过设置{x}stylename属性,可以将其指向css选择器。