<a href="url#"><a name="">
Browser |
|
---|---|
Type |
The A element defines an anchor.
You can create a link to a named anchor by using the name attribute (or the id attribute).
When linking to another document, the A element is set as follows.
example1.html
<a href="example2.html#Anchorname">linked text</a>
example2.html (Target point)
<a name="Anchorname">a named anchor</a>
Attribute | Value | Explanation |
---|---|---|
href=" " | URL#anchor name | the target URL, number sign (#), and anchor name |
name=" " | anchor name | arbitrary name |
- Create a named anchor
-
- Anchor names must be unique within a document.
- Anchor names are case-sensitive.
- The following symbols can be included in an anchor name.
hyphen(-), underscore(_), colon(:), period(.)
name="anchor_name" - Anchor names must start in the alphabet.
name="a001"
- Link to a named anchor
-
- Type the target URL, a number sign (#), and the name of the anchor.
href="example.html#a001"
- Type the target URL, a number sign (#), and the name of the anchor.