Widget styles

Many display characteristics of an individual widget depend on whether you include styles. The rules are as follows: :

If you do not specify styles, the default settings of the browser determine characteristics such as the line widths, the spacing between widgets, and the text font.

Best practice for styles

Rich UI projects are likely to be most successful if your company divides the responsibility for two tasks—laying out the user interface, as handled by an EGL developer, and creating the interface look and feel, as handled by a web designer. To make this division of labor possible, we recommend that you use external style sheets. You can rely on a default class name such as EglRuiTextField. Alternatively, you can assign your own class name by assigning a value to the class property for a given widget.

The effect of removing all children from the document body

Consider the following statement:
   document.body.removeChildren();
The effect is twofold:
  • Removes all children widgets from the web page
  • Removes access to the external style sheet, if any
If you wish to remove children from the document body without removing access to the external style sheet, remove specific children, as in the following statement:
   document.body.removeChild(myBox);

Sources of additional information

For details on cascading style sheets, consider the following websites:

   http://www.w3schools.com/css

At this writing, the left side of that website includes several links, and the choices under the heading CSS Basic are of particular interest for Rich UI. The site search at the right is also useful.

For a complete description of cascading style sheets, see CSS: The Definitive Guide by Meyer (O'Reilly Media, Inc., November 2006).