婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > flex4.5中CSS選擇器的應用小結

flex4.5中CSS選擇器的應用小結

熱門標簽:中山外呼系統中間件 天津企業外呼系統代理商 地圖標注多家店 車載電話機器人 外呼系統號碼顯示 無錫電銷外呼系統代理 廣州ai外呼系統業務 什么行業需要電話機器人 南昌crm外呼系統如何
CSS選擇器可以包括,標簽選擇器、類別選擇器、ID選擇器、交集選擇器、并集選擇器、后代選擇器、全局選擇器、偽類等,這些樣式應用都已經在flex得到支持

1.標簽選擇器
標簽選擇器是根據MXML文件中組件的類型來設置的,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|TextInput{
color: #FF0000;
}
s|Button{
color: #FFFF00;
}
/fx:Style>
s:TextInput text="text input"/>
s:Button label="button"/>

上面二個控件的顏色會隨之改變。
2.類別選擇器
類別選擇器是以一個點開頭,后面加上組件中通過styleName設置的樣式名來表示的類別選擇器,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
.btn2{
color: #FF0000;
}
/fx:Style>
s:Button label="button2" styleName="btn2"/>

3.ID選擇器
ID選擇器是以#開頭,后面加上組件中設置的ID名來表示的類別選擇器,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
#btn1{
color: #FF0000;
}
.btn2{
color: #FF00FF;
}
/fx:Style>
s:Button id="btn1" label="button1"/>
s:Button label="button2" styleName="btn2"/>

4.交集選擇器
交集選擇器由兩個選擇器直接連接構成,其結果是選中二者各自元素范圍的交集,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|Button#btn1{
color: #FF0000;
}
s|Button.btn2{
color: #FF00FF;
}
/fx:Style>
s:Button id="btn1" label="button1"/>
s:Button label="button2" styleName="btn2"/>
s:Button label="button3"/>

5.并集選擇器
并集選擇器是多個選擇器通過逗號連接而成的,并集選擇器同時選中各個基本選擇器所選擇的范圍,任何形式的選擇器都可以,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|Button#btn1,s|Button.btn2{
color: #FF0000;
}
/fx:Style>
s:Button id="btn1" label="button1"/>
s:Button label="button2" styleName="btn2"/>
s:Button label="button3"/>

6.后代選擇器
后代選擇器也叫派生選擇器,可以使用后代選擇器給一個元素里的子元素定義樣式,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|HGroup s|TextInput{
color: #FF0000;
}
/fx:Style>
s:HGroup verticalAlign="middle">
s:Label text="Text Input 1"/>
s:TextInput text="sample"/>
/s:HGroup>
s:TextInput text="sample"/>

7.全局選擇器
全局選擇器global可以將樣式應用到所有的組件,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
global{
color: #FF0000;
}
/fx:Style>
s:Label text="label"/>
s:TextInput text="text input"/>
s:Button label="button"/>

8.偽類
偽類是用來設置組件在不同狀態下的樣式,示例如下:
復制代碼 代碼如下:

fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|Button:up{
color: #FF0000;
}
s|Button:down{
color: #FF00FF;
}
s|Button:over{
color: #0000FF;
}
/fx:Style>
s:Button label="button"/>

標簽:呂梁 海西 攀枝花 仙桃 滄州 泰州 佛山 欽州

巨人網絡通訊聲明:本文標題《flex4.5中CSS選擇器的應用小結》,本文關鍵詞  flex4.5,中,CSS,選擇器,的,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《flex4.5中CSS選擇器的應用小結》相關的同類信息!
  • 本頁收集關于flex4.5中CSS選擇器的應用小結的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 青铜峡市| 平泉县| 郎溪县| 兴山县| 林口县| 都昌县| 临澧县| 南澳县| 巴林右旗| 遂平县| 福建省| 河北省| 阳高县| 通州市| 肇源县| 壤塘县| 北碚区| 寻乌县| 上饶县| 丁青县| 许昌市| 桐城市| 黎城县| 哈巴河县| 都昌县| 云南省| 高陵县| 原阳县| 夏邑县| 横峰县| 临颍县| 西宁市| 卓资县| 子洲县| 长乐市| 九龙坡区| 湖州市| 中牟县| 韶关市| 靖边县| 牡丹江市|