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 version=”1.0″?>






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

s|Button {

fontSize: 15;

color: #9933FF;




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

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




Tags: , , , , , ,