2010-04-28 79 views
1

我有我想要工作的以下CSS。我確信我曾經做過類似的事情,但我無法在Google上找到答案。使用CSS來設置樣式類

基本上一些樣式屬性具有可以更改的子屬性,例如Container.borderSkin。你可以在borderSkin樣式中設置borderThickness,borderStyle等。

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

     MyControl 
     { 
      borderSkin: .myBorderSkin; 
     } 
</mx:Style> 

不幸的是,當我運行應用程序,我得到的錯誤「類型錯誤:錯誤#1034:類型強制失敗:不能將‘myBorderSkin’上課」。

回答

0

這是我想的是:

ButtonBar 
{ 
     buttonStyleName: "buttonBarButton"; 
     firstButtonStyleName: "firstButtonBarButton"; 
     lastButtonStyleName: "lastButtonBarButton"; 
} 

.buttonBarButton 
{ 
     color: #000000; 
     textRollOverColor: #000000; 
     textSelectedColor:#000000; 
} 

通過設置{X} styleName屬性,你可以在一個CSS選擇器指向它。