(2005年4月付け、2005年4月現在)
[24]
歴史的にはともかく、 [CODE(HTMLe)[[[a]]]]
の中に入れることができるのは[[行内要素]]だけです。
にもかかわらず、 [CODE(HTMLe)[[[li]]]]
とかを入れられるという解説が未だに後を絶ちません・・・。
リスト項目をリンクにしたいと思うのはもっともですが、
できないものはできないのでしてね・・・。
[[#comment]]
** 実装
[17] [CODE(HTMLa)[a]] 要素は (意味的に適切かという問題はあるにせよ、
構文的に) 空にもなり得るので、 UA は空の終点アンカーを探すこともできるべきですが、
そうでない UA もあると HTML 4 仕様書は言っています。
UA によってはうまく機能しない例
[PRE(HTML)[
...some HTML...
Link to empty anchor
]PRE]
(HTML 4 仕様書より、改)
[[#comment]]
** 例
[12] 単純な始点アンカーの例
[PRE(HTML)[
For more information about W3C, please consult the
W3C Web site.
]PRE]
(HTML 4 仕様書より)
レンダリング例:
[PRE[
For more information about W3C, please consult the W3C Web site.
~~~~~~~~~~~~
]PRE]
[15]
[PRE(HTML)[
...text before the link...
For more information, please consult anchor one.
...text after the link...
]PRE]
(HTML 4 仕様書より、改)
同じ階層の [SAMP(URI)[one.html]] (>>13) の終点アンカー [SAMP[ANCHOR-ONE]]
への連結の例。
[13] 単純な終点アンカーの例
[PRE(HTML)[
...text before the anchor...
This is the location of anchor one.
...text after the anchor...
]PRE]
(HTML 4 仕様書より、改)
[16] 始点アンカーかつ終点アンカーな例
[PRE(HTML)[
I just returned from vacation! Here's a
photo of my family at the lake..
]PRE]
(HTML 4 仕様書より、改)
[18] 目次の例
[PRE(HTML)[
Table of Contents
Introduction
Some background
On a more personal note
...the rest of the table of contents...
...the document body...
...section 1...
...section 2...
...section 2.1...
]PRE]
[19] >>18 を [CODE(HTMLa)[id]] に書き換えた例
[PRE(HTML)[
Table of Contents
Introduction
Some background
On a more personal note
...the rest of the table of contents...
...the document body...
Introduction
...section 1...
Some background
...section 2...
On a more personal note
...section 2.1...
]PRE]
(HTML 4 仕様書より)
[[#comment]]
** メモ
[[#comment]]
* メモ