The Style menu enables you to change the appearance of your documents using Cascading Style Sheets (CSS)
The CSS Style entry in the Style menu, or the button, enables you to generate a list of CSS properties. This entry menu displays a dialog box with 4 different tabs: Characters, Colors, Boxes, Format.
When a set of properties are set, the user can apply them to the current selection:
span
elements with a style
attribute or a
style
attribute on the current element.In any case image paths included in the list of properties (background-image, list-style-image) are transformed into relative paths to the selected document.
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.
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.
By hitting F2, the user can see CSS properties applied to enclosing elements. When the user changes the selection by clicking an element in the path of the status bar, displayed at the bottom of the window, CSS properties are updated too.
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.
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.
Five of these Information elements are also available in the XHTML tool:
emphasis ( ), strong ( )
code
( ), insertion ( ), and deletion
( ).
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.
Two of these Character elements are also available in the XHTML tool: superscript ( ), and subscript ( ).
All commands of the submenus Information type Elements and Character Elements are removed when you apply them twice.
To remove a style element:
code
( ), insertion ( ), and