home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 May / Gamestar_73_2005-05_dvd.iso / Programy / amaya / amaya-WinXP-9.1.exe / doc / WX / StyleSheets.html < prev    next >
Encoding:
Extensible Markup Language  |  2005-02-23  |  20.8 KB  |  480 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3.        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6.   <meta name="GENERATOR" content="amaya 9.1, see http://www.w3.org/Amaya/" />
  7.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  8.   <title>Style Sheets</title>
  9.   <link href="style.css" rel="stylesheet" type="text/css" />
  10. </head>
  11.  
  12. <body xml:lang="en" lang="en">
  13.  
  14. <div>
  15. <img alt="Amaya" src="../../resources/icons/22x22/logo.png" class="logo" />
  16.  
  17. <p class="nav"><a href="Xml.html" accesskey="p"><img alt="previous"
  18. src="../../resources/icons/misc/left.png" /></a> <a href="Manual.html"
  19. accesskey="t"><img alt="top" src="../../resources/icons/misc/up.png" /></a>
  20. <a href="Searching.html" accesskey="n"><img alt="next"
  21. src="../../resources/icons/misc/right.png" /></a></p>
  22. </div>
  23.  
  24. <div class="toc">
  25. <ul>
  26.   <li><a href="#Cascading">Cascading Style Sheets (CSS)</a>
  27.     <ul>
  28.       <li><a href="#About">About Linking External and User Style Sheets</a>
  29.         <ul>
  30.           <li><a href="#Handling">Handling External CSS Style Sheets</a></li>
  31.           <li><a href="#Creating3">Creating and Updating some CSS
  32.             properties</a></li>
  33.         </ul>
  34.       </li>
  35.       <li><a href="#Showing">Showing Applied Style</a></li>
  36.       <li><a href="#Associatin">Associating a Class to an Element</a></li>
  37.       <li><a href="#Creating">Creating and Updating a Style Attribute</a>
  38.         <ul>
  39.           <li><a href="#Colors">Colors</a></li>
  40.           <li><a href="#Characters">Characters</a></li>
  41.           <li><a href="#Format">Format</a></li>
  42.           <li><a href="#Background">Background image</a></li>
  43.           <li><a href="#Creating1">Creating a Generic Style for an Element or
  44.             Class</a></li>
  45.         </ul>
  46.       </li>
  47.       <li><a href="#About1">About Applying Style Using HTML Elements</a>
  48.         <ul>
  49.           <li><a href="#Creating2">Creating HTML Style Elements</a></li>
  50.           <li><a href="#Informatio">Information Types</a></li>
  51.           <li><a href="#Character">Character Elements</a></li>
  52.           <li><a href="#Removing">Removing Style Elements</a></li>
  53.         </ul>
  54.       </li>
  55.     </ul>
  56.   </li>
  57. </ul>
  58. </div>
  59.  
  60. <div id="page_body">
  61. <h2 id="Cascading">Cascading Style Sheets (CSS)</h2>
  62.  
  63. <p>The <strong>Style</strong> menu enables you to change the appearance of
  64. your documents using Cascading Style Sheets (CSS)</p>
  65.  
  66. <h3 id="About">About Linking External and User Style Sheets</h3>
  67.  
  68. <p>A document can link to several external style sheets that are downloaded
  69. with the document and applied to it.</p>
  70.  
  71. <p>An external style sheet can apply to multiple documents. When the same
  72. style sheet applies to several displayed documents, Amaya loads only one
  73. instance of the style sheet.</p>
  74.  
  75. <p>Any user can define a specific style sheet that applies to all documents
  76. loaded on their system. This style sheet is called the <b>user's</b> style
  77. sheet. It is stored in the user's local environment, in the <span
  78. class="Link0"><code><a href="Configure.html#AmayaHome">AmayaHome</a></code>
  79. directory</span> as the local file
  80. <code><strong>amaya.css</strong></code>.</p>
  81.  
  82. <p>For example, if you prefer to display documents in Helvetica on your
  83. screen and print them in small size, you can create a user's style sheet with
  84. following CSS rules:</p>
  85.  
  86. <p><code>@media print {<br />
  87. body {font-size: 10pt}<br />
  88. }<br />
  89. @media screen {<br />
  90. body {font-family: Helvetica}<br />
  91. }</code></p>
  92.  
  93. <h4 id="Handling">Handling External CSS Style Sheets</h4>
  94.  
  95. <p>The <strong>Style</strong> menu provides a set of commands which enable
  96. you to control external and user's CSS style sheets.</p>
  97. <ul>
  98.   <li>Select <strong>Link</strong> to link a new CSS style sheet to the
  99.     current document. Amaya displays a pointing hand cursor.
  100.     <p>This command shows a dialog box.</p>
  101.     <ul>
  102.       <li>If the target CSS style sheet is displayed in another Amaya window
  103.         and you want to select it by click, click the <strong>Click</strong>
  104.         button then click anywhere within that window to create the link.</li>
  105.       <li>If the target CSS style sheet is displayed in another tab and you
  106.         want to select it by click, click the <strong>Click</strong> button
  107.         then change the current tab and click anywhere within the target CSS
  108.         style sheet to create the link.</li>
  109.       <li>If the target CSS style sheet is a local file you can use the
  110.         <strong>Browse</strong> button to select it.</li>
  111.       <li>Else type the URI (like http://www.w3.org/file.css) of the target
  112.         CSS style sheet and then <strong>Confirm</strong> to create the
  113.       link.</li>
  114.     </ul>
  115.     <p></p>
  116.   </li>
  117.   <li>Select <strong>Open</strong> to open a CSS style sheet applied to the
  118.     current document.
  119.     <p></p>
  120.   </li>
  121.   <li>Select <strong>Disable</strong> to remove the effect of an enabled CSS
  122.     style sheet from the current document. This command does not affect the
  123.     CSS link in the document.
  124.     <p></p>
  125.   </li>
  126.   <li>Select <strong>Enable</strong> to reapply the effects of a disabled CSS
  127.     style sheet to the current document. This command does not affect the CSS
  128.     link in the document.
  129.     <p></p>
  130.   </li>
  131.   <li>Select <strong>Remove</strong> to remove an external CSS style sheet.
  132.     This command is similar to the Disable command, but it also removes the
  133.     element link that attaches the external CSS style sheet.</li>
  134. </ul>
  135.  
  136. <p>The <strong>Open</strong>, <strong>Disable</strong> and
  137. <strong>Enable</strong> commands can be applied to the user's preference
  138. style sheet, but the <strong>Link</strong> and <strong>Remove</strong>
  139. commands apply to only external CSS style sheets.</p>
  140.  
  141. <h4 id="Creating3">Creating and Updating some CSS properties</h4>
  142. <ul>
  143.   <li><a href="#Colors">Colors</a></li>
  144.   <li><a href="#Characters">Characters</a></li>
  145.   <li><a href="#Format">Format</a></li>
  146. </ul>
  147.  
  148. <p>Following <a href="#Colors">Colors</a>, <a
  149. href="#Characters">Characters</a>, and <a href="#Format">Format</a> tools
  150. enable you to directly generate CSS properties into a style sheet file.</p>
  151.  
  152. <p>When the style property is applied and the selection is within a style
  153. sheet, Amaya inserts the CSS property at the current position.</p>
  154.  
  155. <h3 id="Showing">Showing Applied Style</h3>
  156.  
  157. <p>If there are a lot of style sheets attached to a document, it's difficult
  158. to understand why an element is displayed with that color or these margins,
  159. etc. To help the user, Amaya provides a <strong>Show applied style</strong>
  160. command that displays into an external window CSS style properties applied to
  161. the first current selected element.</p>
  162.  
  163. <p>The user can then display the CSS source that generates each property by
  164. double (or simple) click on the property. As long as the window is open,
  165. Amaya updates the window content when the selection changes. Hitting
  166. <code>F2</code>, the user can so see CSS properties applied to enclosing
  167. elements.</p>
  168.  
  169. <h3 id="Associatin">Associating a Class to an Element</h3>
  170.  
  171. <p>All classes available for the document are listed in the <strong>Apply
  172. Class</strong> tool.</p>
  173.  
  174. <p class="ProcedureCaption">To apply a class to an element:</p>
  175. <ol>
  176.   <li>Choose the right entry within the <strong>Apply Class</strong>
  177.   tool.</li>
  178.   <li>If you want to select the class applied to another element, you have to
  179.     select this element, then click the <img alt="Refresh"
  180.     src="../../resources/icons/16x16/refresh.png" /> button. The
  181.     <strong>Apply Class</strong> list is refreshed and the current applied
  182.     class is selected.</li>
  183.   <li>Select a piece of text or an element.<br />
  184.     To select an element, you have to click within the element, then use the
  185.     <code>F2</code> key until the bottom line of the window displays its type
  186.     in first position. You can also use the Structure view to select it.</li>
  187.   <li>Click the <img alt="ok" src="../../resources/icons/16x16/ok.png" />
  188.     button to apply the class to the current selection.<br />
  189.     If a piece of text is selected, Amaya will generate a
  190.     <strong>span</strong> element to enclose the current text and the
  191.     <strong>class</strong> attribute will be attached to this new
  192.     <strong>span</strong> element.</li>
  193. </ol>
  194.  
  195. <p>To associate a <strong>class</strong> with an element, you can also use
  196. the <strong>Attributes</strong> tool. This <a
  197. href="Attributes.html">Attributes</a> tool also enables you to delete a
  198. <strong>class</strong> attribute from an element or to change it (the class
  199. attribute is handled like any other attribute).</p>
  200.  
  201. <p class="ProcedureCaption">To remove the class of an element:</p>
  202. <ul>
  203.   <li>You can edit the <strong>class</strong> attribute in the
  204.     <strong>Attributes</strong> tool.
  205.     <p>When the element is selected, you click on the [X] of the entry to
  206.     remove the class attribute, or you click on the entry and edit its value
  207.     then confirm with the apply (<img alt="ok"
  208.     src="../../resources/icons/16x16/ok.png" />) button.</p>
  209.   </li>
  210.   <li>You can also remove or edit the <strong>class</strong> attribute in the
  211.     structure view.
  212.     <p>To remove the <strong>class</strong> attribute, you click in the
  213.     value, <code>F2</code> lets you select the whole value, then hit the
  214.     <code>Delete</code> key twice.</p>
  215.   </li>
  216. </ul>
  217.  
  218. <h3 id="Creating">Creating and Updating a Style Attribute</h3>
  219.  
  220. <p>Amaya provides tools that let you associate a style attribute with the
  221. currently selected elements:</p>
  222.  
  223. <h4 id="Colors">Colors</h4>
  224.  
  225. <p>The <strong>Colors</strong> tool lets you choose the foreground and
  226. background colors from a palette. When the <strong>Colors</strong> tool is
  227. open:</p>
  228.  
  229. <p><ul>
  230.   <li>A button <img alt="default"
  231.     src="../../resources/icons/16x16/default.png" /> (default value) or a
  232.     colored rectangle shows the foreground color.</li>
  233.   <li>A button <img alt="default"
  234.     src="../../resources/icons/16x16/default.png" /> (default value) or a
  235.     colored rectangle shows the background color.</li>
  236.   <li>A button <img alt="switch"
  237.     src="../../resources/icons/misc/switch_colors.png" /> allows one to
  238.     switch foreground and background colors.</li>
  239.   <li>A button <img alt="Default_color"
  240.     src="../../resources/icons/misc/black_white.png" /> allows one to restore
  241.     default colors (default values).</li>
  242.   <li>A button <img alt="Refresh"
  243.     src="../../resources/icons/16x16/refresh.png" /> allows one to initialize
  244.     the foreground and background colors form the current selection.</li>
  245.   <li>A button <img alt="ok" src="../../resources/icons/16x16/ok.png" />
  246.     allows one to apply the foreground and background colors to the current
  247.     selection.</li>
  248. </ul>
  249. </p>
  250.  
  251. <p>To select a new foreground or background color, one must click the
  252. associated button. A palette allows then to freely select a color.</p>
  253.  
  254. <p>The default option enables you to remove the corresponding style
  255. information for the selected elements. Selected colors are not immediately
  256. applied to the current selection. The apply button must be clicked.</p>
  257.  
  258. <p class="Note"><strong>Note</strong>: It's important to selected enough
  259. contrasted foreground and background colors.</p>
  260.  
  261. <h4 id="Characters">Characters</h4>
  262.  
  263. <p>The <strong>Characters</strong> tool lets you choose the font family, the
  264. character style, the body size, and the underline style.</p>
  265. <ul>
  266.   <li>A <strong>Font family</strong> selector provides limited list of fonts.
  267.     A button <img alt="ok" src="../../resources/icons/16x16/ok.png" /> allows
  268.     one to apply only this value to the current selection.</li>
  269.   <li>An <strong>Underline</strong> selector provides the list of possible
  270.     underline values. A button <img alt="ok"
  271.     src="../../resources/icons/16x16/ok.png" /> allows one to apply only this
  272.     value to the current selection.</li>
  273.   <li>A <strong>Body size</strong> selector provides limited list of font
  274.     sizes expressed in points. A button <img alt="ok"
  275.     src="../../resources/icons/16x16/ok.png" /> allows one to apply only this
  276.     value to the current selection.</li>
  277.   <li>A <strong>Character style</strong> selector provides limited list of
  278.     character styles. A button <img alt="ok"
  279.     src="../../resources/icons/16x16/ok.png" /> allows one to apply only this
  280.     value to the current selection.</li>
  281.   <li>A <strong>Boldness</strong> selector provides a limited list of
  282.     possible boldness values. A button <img alt="ok"
  283.     src="../../resources/icons/16x16/ok.png" /> allows one to apply only this
  284.     value to the current selection.</li>
  285.   <li>A button <img alt="Refresh"
  286.     src="../../resources/icons/16x16/refresh.png" /> allows one to initialize
  287.     values form the current selection.</li>
  288.   <li>A button <img alt="ok" src="../../resources/icons/16x16/ok.png" />
  289.     allows one to apply all selected values to the current selection.</li>
  290. </ul>
  291.  
  292. <p>The default option enables you to remove the corresponding style
  293. information for the selected elements. Selected values are not immediately
  294. applied to the current selection. The apply button must be clicked.</p>
  295.  
  296. <h4 id="Format">Format</h4>
  297.  
  298. <p>The <strong>Format</strong> tool enables you to set alignment,
  299. indentation, justification, and line spacing.</p>
  300. <ul>
  301.   <li>An alignmentáselector: click left (<img alt="left"
  302.     src="../../resources/icons/16x16/format_left.png" />), right ( <img
  303.     alt="right" src="../../resources/icons/16x16/format_right.png" />),
  304.     center ( <img alt="center"
  305.     src="../../resources/icons/16x16/format_center.png" />), or justify (
  306.     <img alt="justify" src="../../resources/icons/16x16/format_justify.png"
  307.     />), or <img alt="default" src="../../resources/icons/16x16/default.png"
  308.     /> for the default value.</li>
  309.   <li>An <strong>Indent</strong> selector that enables you to type a point
  310.     value. Click the <img alt="default"
  311.     src="../../resources/icons/16x16/default.png" /> button for the default
  312.     value.</li>
  313.   <li>A <strong>Line spacing</strong> selector that enables you to type o
  314.     point value. Click the <img alt="default"
  315.     src="../../resources/icons/16x16/default.png" /> button for the default
  316.     value.</li>
  317.   <li>A button <img alt="Refresh"
  318.     src="../../resources/icons/16x16/refresh.png" /> allows one to initialize
  319.     values form the current selection.</li>
  320.   <li>A button <img alt="ok" src="../../resources/icons/16x16/ok.png" />
  321.     allows one to apply values to the current selection.</li>
  322. </ul>
  323.  
  324. <p>The default option enables you to remove the corresponding style
  325. information for the selected elements. Selected values are not immediately
  326. applied to the current selection. The apply button must be clicked.</p>
  327.  
  328. <h4 id="Background">Background image</h4>
  329.  
  330. <p>This entry in the <strong>Style</strong> menu enables you to choose a
  331. background image and its repeat mode.</p>
  332.  
  333. <p class="ProcedureCaption">To add a background image:</p>
  334. <ol>
  335.   <li>Select an element.<br />
  336.     To select an element, you have to click within the element, then use the
  337.     <code>F2</code> key until the bottom line of the window displays its type
  338.     in first position. You can also use the Structure view to select it.</li>
  339.   <li>Click the <strong>Background image</strong> entry in the Style menu to
  340.     open the dialogue box which enables you to:
  341.     <ul>
  342.       <li>Enter the Image URI or browse.<br />
  343.       </li>
  344.       <li>Select the repeat mode: repeat (<img alt="repeat"
  345.         src="../../resources/icons/16x16/BG_repeat.png" />), x-repeat ( <img
  346.         alt="x-repeat" src="../../resources/icons/16x16/BG_repeat_x.png" />),
  347.         y-repeat (<img alt="y-repeat"
  348.         src="../../resources/icons/16x16/BG_repeat_y.png" />), or no-repeat
  349.         (<img alt="no-repeat"
  350.         src="../../resources/icons/16x16/BG_norepeat.png" />).</li>
  351.     </ul>
  352.   </li>
  353. </ol>
  354.  
  355. <p class="ProcedureCaption">To remove a background image:</p>
  356. <ul>
  357.   <li>Edit the <strong>style</strong> attribute in the
  358.     <strong>Attributes</strong> tool.
  359.     <p>When the element is selected, you click on the [X] before the entry to
  360.     remove the style attribute, or you click on the entry and edit its value
  361.     then confirm with the apply (<img alt="ok"
  362.     src="../../resources/icons/16x16/ok.png" />) button.</p>
  363.   </li>
  364.   <li>Or Remove or edit the <strong>style</strong> Attribute in the structure
  365.     view.
  366.     <p>You select directly the <strong>style</strong> attribute content and
  367.     remove the background-image rule. To remove the <strong>style</strong>
  368.     attribute you click within the value, <code>F2</code> to select the whole
  369.     value, then hit the <code>Delete</code> key twice.</p>
  370.   </li>
  371. </ul>
  372.  
  373. <h4 style="" id="Creating1">Creating a Generic Style for an Element or
  374. Class</h4>
  375.  
  376. <p>When a <strong>style</strong> attribute is associated with an element, you
  377. can use that element as a model for creating or modifying a style rule by
  378. using the <strong>Create Rule</strong> command.</p>
  379.  
  380. <p class="ProcedureCaption">To create a generic style for an element or
  381. class:</p>
  382. <ol>
  383.   <li>Select the element you wish to use as the template. By default the
  384.     selection is set to the character string, and you have to press the
  385.     <code>F2</code> key to select the enclosing element.
  386.     <p></p>
  387.     <p class="Note"><strong>Note:</strong> You must select only one element
  388.     and this element must have a style attribute.</p>
  389.     <p></p>
  390.   </li>
  391.   <li>Choose <strong>Create Rule</strong> from the <strong>Style</strong>
  392.     menu. Amaya opens a dialog displaying a list of CSS selectors. This list
  393.     contains all classes that are defined for the current document (including
  394.     those defined in linked CSS style sheets), as well as the element type to
  395.     which the style is associated.
  396.     <p></p>
  397.   </li>
  398.   <li>Choose a selector in this list or enter a new class name and click
  399.     <strong>Confirm</strong>.
  400.     <p>The style of the selected element is then associated with the chosen
  401.     selector and the style attribute is removed from the selected element.
  402.     Its content is moved to the <code>style</code> element, in the document
  403.     <code>HEAD</code>, and all elements matching the selector are displayed
  404.     with the new style.</p>
  405.   </li>
  406. </ol>
  407.  
  408. <p>When a new class is created with the command <strong>Create Rule</strong>,
  409. this class is automatically added to the list of the <strong>Apply
  410. Class</strong> tool.</p>
  411.  
  412. <h3 id="About1">About Applying Style Using HTML Elements</h3>
  413.  
  414. <p>HTML provides some character-level elements so you can associate style
  415. with character strings. Two options on the <strong>XHTML</strong> menu enable
  416. you to handle these HTML elements:</p>
  417. <ul>
  418.   <li>Information type</li>
  419.   <li>Character element</li>
  420. </ul>
  421.  
  422. <h4 id="Creating2">Creating HTML Style Elements</h4>
  423.  
  424. <p>Two submenus on the <strong>XHTML</strong> menu enable you to add HTML
  425. elements to your CSS style sheet: <strong>Information Type</strong> and
  426. <strong>Character Elements</strong>.</p>
  427.  
  428. <h4 id="Informatio">Information Types</h4>
  429.  
  430. <p>The <strong>Information Type</strong> submenu lists HTML elements that
  431. define abstract styles.</p>
  432.  
  433. <p class="ProcedureCaption">To apply an information type:</p>
  434. <ol>
  435.   <li>Select a character string in your page.</li>
  436.   <li>Choose an option from the <strong>Information Types</strong> submenu.
  437.     <p>The selected character string displays in the chosen style.</p>
  438.   </li>
  439. </ol>
  440.  
  441. <p>Three of these styles are also available in the XHTML tool:
  442. <em>emphasis</em> (<img src="../../resources/icons/22x22/XHTML_I.png"
  443. alt="Emphasis button" />), <strong>strong</strong> (<img
  444. src="../../resources/icons/22x22/XHTML_B.png" alt="Strong button" />) and
  445. <code>code</code> (<img src="../../resources/icons/22x22/XHTML_T.png"
  446. alt="Code button" />).</p>
  447.  
  448. <h4 id="Character">Character Elements</h4>
  449.  
  450. <p>The <strong>Character Elements</strong> submenu of the XHTML menu provides
  451. another set of style elements.</p>
  452.  
  453. <p class="ProcedureCaption">To apply a character element:</p>
  454. <ol>
  455.   <li>Select a character string in your page.</li>
  456.   <li>Choose an option from the <strong>Character Elements</strong> submenu.
  457.     <p>The selected character string displays the chosen style.</p>
  458.   </li>
  459. </ol>
  460.  
  461. <h4 id="Removing">Removing Style Elements</h4>
  462.  
  463. <p>áAll commands of the submenus <strong>Information Types</strong> and
  464. <strong>Character Elements</strong> are removed when you apply them twice.</p>
  465.  
  466. <p class="ProcedureCaption">To remove a style element:</p>
  467. <ol>
  468.   <li>Select the element you want to remove. By default the selection is set
  469.     to the character string, and you have to press the <code>F2</code> key to
  470.     select the enclosing element.</li>
  471.   <li>Reapply the command from the <strong>Information Type</strong> or
  472.     <strong>Character Elements</strong> submenu of the <strong>XHTML</strong>
  473.     menu.</li>
  474. </ol>
  475.  
  476. <p></p>
  477. </div>
  478. </body>
  479. </html>
  480.