The Style menu enables you to change the appearance of your documents using Cascading Style Sheets (CSS)
A document can link to several external style sheets that are downloaded with the document and applied to it.
An external style sheet can apply to multiple documents. When the same style sheet applies to several displayed documents, Amaya loads only one instance of the style sheet.
Any user can define a specific style sheet that applies to all documents
loaded on their system. This style sheet is called the user's style
sheet. It is stored in the user's local environment, in the AmayaHome
directory as the local file
amaya.css
.
For example, if you prefer to display documents in Helvetica on your screen and print them in small size, you can create a user's style sheet with following CSS rules:
@media print {
body {font-size: 10pt}
}
@media screen {
body {font-family: Helvetica}
}
The Style menu provides a set of commands which enable you to control external and user's CSS style sheets.
This command shows a dialog box.
The Open, Disable and Enable commands can be applied to the user's preference style sheet, but the Link and Remove commands apply to only external CSS style sheets.
Following Colors, Characters, and Format tools enable you to directly generate CSS properties into a style sheet file.
When the style property is applied and the selection is within a style sheet, Amaya inserts the CSS property at the current position.
If there are a lot of style sheets attached to a document, it's difficult to understand why an element is displayed with that color or these margins, etc. To help the user, Amaya provides a Show applied style command that displays into an external window CSS style properties applied to the first current selected element.
The user can then display the CSS source that generates each property by
double (or simple) click on the property. As long as the window is open,
Amaya updates the window content when the selection changes. Hitting
F2
, the user can so see CSS properties applied to enclosing
elements.
All classes available for the document are listed in the Apply Class tool.
To apply a class to an element:
F2
key until the bottom line of the window displays its type
in first position. You can also use the Structure view to select it.To associate a class with an element, you can also use the Attributes tool. This Attributes tool also enables you to delete a class attribute from an element or to change it (the class attribute is handled like any other attribute).
To remove the class of an element:
When the element is selected, you click on the [X] of the entry to remove the class attribute, or you click on the entry and edit its value then confirm with the apply () button.
To remove the class attribute, you click in the
value, F2
lets you select the whole value, then hit the
Delete
key twice.
Amaya provides tools that let you associate a style attribute with the currently selected elements:
The Colors tool lets you choose the foreground and background colors from a palette. When the Colors tool is open:
To select a new foreground or background color, one must click the associated button. A palette allows then to freely select a color.
The default option enables you to remove the corresponding style information for the selected elements. Selected colors are not immediately applied to the current selection. The apply button must be clicked.
Note: It's important to selected enough contrasted foreground and background colors.
The Characters tool lets you choose the font family, the character style, the body size, and the underline style.
The default option enables you to remove the corresponding style information for the selected elements. Selected values are not immediately applied to the current selection. The apply button must be clicked.
The Format tool enables you to set alignment, indentation, justification, and line spacing.
The default option enables you to remove the corresponding style information for the selected elements. Selected values are not immediately applied to the current selection. The apply button must be clicked.
This entry in the Style menu enables you to choose a background image and its repeat mode.
To add a background image:
F2
key until the bottom line of the window displays its type
in first position. You can also use the Structure view to select it.To remove a background image:
When the element is selected, you click on the [X] before the entry to remove the style attribute, or you click on the entry and edit its value then confirm with the apply () button.
You select directly the style attribute content and
remove the background-image rule. To remove the style
attribute you click within the value, F2
to select the whole
value, then hit the Delete
key twice.
When a style attribute is associated with an element, you can use that element as a model for creating or modifying a style rule by using the Create Rule command.
To create a generic style for an element or class:
F2
key to select the enclosing element.
Note: You must select only one element and this element must have a style attribute.
The style of the selected element is then associated with the chosen
selector and the style attribute is removed from the selected element.
Its content is moved to the style
element, in the document
HEAD
, and all elements matching the selector are displayed
with the new style.
When a new class is created with the command Create Rule, this class is automatically added to the list of the Apply Class tool.
HTML provides some character-level elements so you can associate style with character strings. Two options on the XHTML menu enable you to handle these HTML elements:
Two submenus on the XHTML menu enable you to add HTML elements to your CSS style sheet: Information Type and Character Elements.
The Information Type submenu lists HTML elements that define abstract styles.
To apply an information type:
The selected character string displays in the chosen style.
Three of these styles are also available in the XHTML tool:
emphasis (), strong () and
code
().
The Character Elements submenu of the XHTML menu provides another set of style elements.
To apply a character element:
The selected character string displays the chosen style.
áAll commands of the submenus Information Types and Character Elements are removed when you apply them twice.
To remove a style element:
F2
key to
select the enclosing element.