
11. Creating and changing links and anchors
11.1. Creating a target anchor
A target anchor is a piece of text that is referred to by a link (a source anchor). Before creating a link to a
text string, you must first turn it into a target anchor.
To create a target anchor:
1. Select the appropriate text string.
2. Choose Create target from the Links menu or click the button in the Elements tool. The
selected text is now a target.
In the Formatted view, if Views/Show targets is turned on, the target text is preceded by a
target icon . In the Links view, icons that identify target anchors are always displayed.
3. When a target anchor is created, Amaya automatically generates the value of the name attribute
by:
◦ Extracting a word longer than 3 characters from the anchor text, or
◦ assigning a number.
In both cases, Amaya guarantees that the generated value is unique within the document. But
you can change this value, in the same way as the value of any attribute.
Note: If you want to create a link to the last target anchor you have created, choose Link to previous
target from the Links menu.
11.2. Creating a target element
In (X)HTML, any element can be used as a target. A target element is an element with an id attribute to
which a link can refer (a source anchor). Before creating a link to such an element, you must first turn it
into a target element.
To create a target element:
1. Select within the element, then press the F2 key to select the entire element. The selection path
at the bottom of the window may be useful to select the right element.
2. Open the Links menu and select Create target or click the button in the Elements tool. The
selected element now has an id attribute that identifies it as a target element.
In the Formatted view, if Views/Show targets is turned on, the target element is preceded by a
target icon . In the Links view, icons that identify target elements are always displayed.
3. When a target element is created, Amaya automatically generates the value of the id attribute
by:
◦ Extracting a word longer than 3 characters from the anchor text.
or
◦ assigning a number.
In both cases, Amaya guarantees that the generated value is valid and unique within the
document. But you can change this value, in the same way as the value of any attribute.
Note: You can also directly create the id attribute by selecting the element and using the Attributes
list. When you enter an attribute value, Amaya checks it for uniqueness, and changes the value if it is
already used by another name or id attribute in the same document.
11. Creating and changing links and anchors
31
Komentarze do niniejszej Instrukcji