Posts Tagged ‘Type selectors’

Type selectors in CSS for Flex 4 or FB 4

March 11th, 2011 by aabhaanjan

Type selectors assign styles to all components of a particular type. Flex applies the style to all classes of that type. Flex also applies the style properties defined by a type selector to all subclasses of that type.

To  use type selectors we required to specify which namespace each type appears in with the @namespace directive.

Example :

[xml]

<?xml version=”1.0″?>

<s:Application

xmlns:fx=”http://ns.adobe.com/mxml/2009″

xmlns:mx=”library://ns.adobe.com/flex/mx”

xmlns:s=”library://ns.adobe.com/flex/spark”>

<fx:Style>

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

s|Button {

fontSize: 15;

color: #9933FF;

}

</fx:Style>

<s:VGroup>

<s:Button id=”myButton” label=”Click Me”/>

<s:Button id=”myButton2″ label=”Click Me”/>

</s:VGroup>

</s:Application>

[/xml]

Tags: , , , , , ,