home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Style Sheets</title>
- <meta name="GENERATOR" content="amaya V4.2.2" />
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- </head>
-
- <body xml:lang="en" lang="en">
-
- <table border="0" width="100%" summary="toc">
- <tbody>
- <tr>
- <td><p><img border="0" alt="W3C" src="../../Icons/WWW/w3c_home" /> <img
- border="0" alt="Amaya" src="../Icons/amaya.gif" /></p>
- </td>
- <td><p align="right"><a href="ImageMaps.html" accesskey="p"><img
- alt="previous" border="0" src="../Icons/left.gif" /></a> <a
- href="Manual.html" accesskey="t"><img alt="top" border="0"
- src="../Icons/up.gif" /></a> <a href="Attributes.html"
- accesskey="n"><img alt="next" border="0" src="../Icons/right.gif"
- /></a></p>
- </td>
- </tr>
- </tbody>
- </table>
-
- <div id="Style">
- <h2><a name="L1023">Style Sheets</a></h2>
-
- <p>The <strong>Style</strong> menu allows you to change the appearance of your
- documents by two different means:</p>
- <ul>
- <li>using Cascading Style Sheets (CSS).</li>
- <li>using HTML elements and attributes.</li>
- </ul>
-
- <p>The first entries of the <strong>Style</strong> menu are dedicated to CSS,
- the last two entries to <a href="#L1371">HTML elements</a>.</p>
-
- <h3><a name="Creating">Creating and updating a style attribute</a></h3>
-
- <p>Each of the first four entries of the <strong>Style</strong> menu call a
- dialog box that allows associating a <code>style</code> attribute with the
- currently selected elements:</p>
- <ul>
- <li><strong>Character Style</strong> allows choosing the font family, the
- character style, the body size and the underline style.</li>
- <li><strong>Colors</strong> allows choosing the foreground and background
- colors from a palette. Click on a palette cell with the left button to set
- the foreground color, click with the middle button to set the background
- color.</li>
- <li><strong>Format</strong> allows setting alignment, indentation,
- justification and linespacing.</li>
- <li><strong>Background Image</strong> allows choosing a background image and
- its repeat mode.</li>
- </ul>
-
- <p>In all these dialog boxes, <strong>Default</strong> buttons allow you to
- remove the corresponding style information for the selected elements.</p>
-
- <p>All modifications made with these dialog boxes can be viewed immediately in
- both the Formatted view and the Structure view.</p>
-
- <h4>Changing Width and Height of elements</h4>
-
- <p>The width and height of any element in a document can be changed
- interactively, in the same way as <a href="ImageMaps.html#L1171">image map
- areas</a>. By pressing the Control key on the keyboard and the middle button
- of the mouse, you can resize the box associated with the element under the
- cursor. When you release the mouse button, the element size is changed and a
- <code>style</code> attribute is associated with the element.</p>
-
- <p>When the resized element is an image, this image is zoomed to fill its new
- box.</p>
-
- <h3><a name="Creating,">Creating, a generic style for an element or a
- class</a></h3>
-
- <p>When a <code>style</code> attribute has been associated with an element,
- you can use that element as a model for creating or modifying a style rule.
- Select this element (you must select only one element and this element must
- have a <code>style</code> attribute) and choose <strong>Create Rule</strong>
- from the <strong>Style</strong> menu. A dialog box pops up that displays a
- list of CSS selectors. This list comprises all classes that are defined for
- the current document as well as, the element type to which the style is
- associated. Choose a selector in this list or enter a new class name and press
- the <strong>Confirm</strong> button. The style of the selected element is then
- associated with the chosen selector and the <code>style</code> attribute is
- removed from the selected element. Its content is moved to the
- <code>STYLE</code> element, in the document <code>HEAD</code>, and all
- elements matching the selector are displayed with the new style.</p>
-
- <p>When you have created new classes with the <strong>Create Rule</strong>
- command, you can associate these classes with some elements in the document.
- Choose <strong>Apply Class</strong> from the <strong>Style</strong> menu. A
- dialog box pops up which displays all existing classes. Choose one of these
- classes. The selected elements are then displayed with the style associated
- with the chosen class.</p>
-
- <p>To associate a class with an element, you can use the <a
- href="Attributes.html#L1073"><strong>Attributes</strong> menu</a> too. This
- menu also allows you to delete a class attribute from an element or to change
- it: the class attribute is handled like any other attribute.</p>
-
- <h3><a name="External">External CSS style sheets and user style
- sheets</a></h3>
-
- <p>A document can link several external style sheets which are downloaded with
- the document and applied to it. One external style sheet can apply to several
- documents. When the same style sheet applies to several displayed documents,
- Amaya loads only one instance of the style sheet.</p>
-
- <p>The user can define a specific style sheet that applies to all loaded
- documents. This style sheet is called the <strong>User's Style Sheet</strong>
- and is the local file <strong>amaya.css</strong> stored in the user's
- environment (the <a href="Configure.html#AmayaHome">AmayaHome Directory</a>).
- For example if you prefer to display documents in Helvetica and to print with
- small fonts size, you may create your user's style sheet with following CSS
- rules:</p>
- <pre>@media print {
- BODY {font-size: 10pt}
- }
- @media screen {
- BODY {font-family: Helvetica}
- }</pre>
-
- <h3><a name="Managing">Handling external CSS style sheets</a></h3>
-
- <p>The entry Style Sheets gives access to a set of commands which allows one
- to control external and User's preference CSS style sheets:</p>
- <ul>
- <li>The command <strong>Link</strong> allows one to link a new CSS style
- sheet to the current document. One can click directly the target style
- sheet if it is already displayed in a Amaya window. In other case the user
- should click in the current document to get a dialog box and type the
- target style sheet's URI. This command adds an element link with its
- attributes into the head of the document.</li>
- <li>The command <strong>Open</strong> allows one to open one of the CSS
- style sheets applied to the current document.</li>
- <li>The command <strong>Disable</strong> allows one to remove effects of one
- of the enabled CSS style sheets to the current document. This command
- doesn't affect the CSS link in the document.</li>
- <li>The command <strong>Enable</strong> allows one to re-apply effects of
- one of the disabled CSS style sheets to the current document. This command
- doesn't affect the CSS link in the document.</li>
- <li>The command <strong>Remove</strong> allows one to remove one of the
- external CSS style sheets. This command acts as the Disable command but in
- addition to that the element link which attaches the external CSS style
- sheet is removed.</li>
- </ul>
-
- <p>Commands Open, Disable and Enable can be applied to the User's preference
- style sheet, but commands Link and Remove concern only linked CSS style
- sheets. The following figure shows the list of CSS style sheets proposed for
- the command Open. If no CSS style sheet is currently applied to a document, a
- dialog box explains that there is "No CSS file available".</p>
-
- <p><img alt="css.gif" src="../Icons/css.gif" /></p>
-
- <p></p>
-
- <h3><a name="L1371">Style through HTML elements</a></h3>
-
- <p>HTML provides some character-level elements that allow you to associate
- style with character strings. Two entries from the <strong>Style</strong> menu
- allow you to handle these HTML elements.</p>
-
- <h4>Creating HTML style elements</h4>
-
- <p>Item <strong>Information type</strong> from the <strong>Style</strong> menu
- presents a submenu offering a choice of HTML elements that define abstract
- styles. Select first a character string in your page and then choose an item
- in this menu. The selected character string receives the corresponding style.
- Three of these styles are also available through buttons: <em>emphasis</em>
- (<img src="../Icons/Em.gif" alt="Emphasis button" />), <strong>strong</strong>
- (<img src="../Icons/Strong.gif" alt="Strong button" />) and <code>code</code>
- (<img src="../Icons/Cour.gif" alt="Code button" />).</p>
-
- <p>Item <strong>Character elements</strong> from the <strong>Style</strong>
- menu offers another menu for changing the style of text. The first entries of
- this menu could be replaced by CSS and should not be used. They are here only
- to complete the HTML 3.2 implementation.</p>
-
- <h4>Removing style</h4>
-
- <p>To remove style from a character string, select the string first and
- re-apply the command that was used for associating the style you want to
- remove. All commands in the submenus <strong>Information Type</strong> and
- <strong>Character Element</strong> toggle themselves if re-applied.</p>
- </div>
-
- <p align="right"><a href="ImageMaps.html"><img alt="previous" border="0"
- src="../Icons/left.gif" /></a> <a href="Manual.html"><img alt="top" border="0"
- src="../Icons/up.gif" /></a> <a href="Attributes.html"><img alt="next"
- border="0" src="../Icons/right.gif" /></a></p>
- <hr />
- </body>
- </html>
-