Widget styles

Many display characteristics of a 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 the style 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, 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.

Removal of all children from the document body

Consider the following statement:
   document.body.removeChildren();
The effect of using this statement is twofold:
  • All children widgets are removed from the Web page
  • Access to the external style sheet, if any, is removed
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 about cascading style sheets, visit the following Web site:

   http://www.w3schools.com/css

For information about Rich UI, see the "CSS Basic" section of that Web site. You might also use the site search.

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


Feedback