Visit Mozilla.org

HTML:Element:a

出典: MDC


◆◆◆ 翻訳中 ◆◆◆

このページは翻訳中です。
翻訳作業に参加する場合は、履歴にある翻訳者と連絡·調整してください。

[編集] サマリ

anchor (<a>) 要素は hyperlink の定義、 名前付けされたターゲットへ送り先へのリンク先への hyperlinkのそれぞれを定義します。

[編集] 属性

accesskey
この属性は要素に対してキーボードナビゲーションアクセサレータを特定するものです。ALT やそれに似たキー(ブラウザやOSによって依存します) と協力して特定のキーでそのキーと相関性があるanchor 要素を選択します。
charset
この要素はリンクされたリソースのキャラクターエンコーディングを指定します。この値はスペースもしくはコンマで分離された RFC 2045 で定義されているキャラクターセットのリストとなります。標準の値は ISO-8859-1 です。
coords
オブジェクトシェイプのために利用し、この属性はコンマで区切られた数字のリストを用いてページ内のオブジェクトの座標を定義するのに使います。
datafld
この属性はバウンドデータから提供されるデータソースオブジェクトからコラム名を定義します。この属性は Microsoft の Internet Explorer 4 の Data Binding で定義されました。
datasrc
この属性はその属性の境界となるデータを提供するデータソースオブジェクトのidを示します。この属性は Microsoft の Internet Explorer 4 の Data Binding で定義されました。
href
これはハイパーテキストのソースへのリンクを定義するアンカーのために唯一要求される属性です。これはリンクのターゲット、もしくはURLもしくは名前の前にハッシュマーク(#)で示されるようなURLの断片を示し、この断片が示すのは現在のドキュメントの内の内部のターゲットのロケーションとなります。URL は Web (http) ベースのドキュメントに限られません。URLはブラウザがサポートするいかなるプロトコルも使う事ができます。例えば、file、ftp、そしてmailtoは多くのユーザエージェントで動作します。
hreflang
この属性はリンク先のリソースの言語を示すのに利用されます。 を前に可能な値の情報を参照している別表である "Language Reference," を先に参照してください。
methods
この属性の値は関数がオブジェクトに対してどのように振る舞うかについての情報を提供する。 この値は基本的にHTTPプロトコルが利用された時に与えられ、しかしながら (タイトル属性と同じような理由で) リンクの前持って報告の情報を含むのに活用される。例えば、ブラウザはたぶん関数のメソッドが定義されたリンクによって異なるレンダリングを選択する; あるものはデフォルトアイコンを取得させるために検索をしたり、ほかのリンクでは現在のサイトから離れるようレンダーに指示をしたりするでしょう。この属性はあまりよく理解されていないが、サポートはされている、Internet Explorer 4 ですら定義されていたりする。
ping Firefox 3 の新機能
もし存在するなら、この属性はスペースで区切られた URI のリストが与えられ、これらはハイパーリンクを辿る際に通知を行なう事を望まれる。 Firefox はリストの HTTP URI それぞれに POST リクエストを送ります。 ping 属性の機能は browser.send_pings 設定を false に設定する事で無効にできます。
name
この属性はページ内のターゲットロケーションを定義するアンカーを要求する。name の値はコア属性の id の値に似ていて、英数字の一意名でドキュメント中でユニークな値となるでしょう。HTML 4.01 仕様においては、 id と name の両方を <a> 要素と長い間同じ値として共に使われています。
rel
href 属性を含む anchor に対して、この属性はターゲットオブジェクトからリンクオブジェクトへ関連性を定義します。この値は関連する値をカンマで区切ったリストとなります。この値とそれらが意味するものは同じ出典によって関連づけられて、それらはドキュメント作者によって意味づけられるでしょう。標準の関連性では、もし何も他に与えられなかったらそれは空になるでしょう。rel 属性は href 属性が与えられた時のみ使われるでしょう。
rev
この属性は逆方向のリンクを定義し、rel 属性とは逆の関連性を持ちます。これはドキュメントの作者のようなオブジェクトが来るようなものを指定するのに有効です。
shape
This attribute is used to define a selectable region for hypertext source links associated with a figure to create an image map. The values for the attribute are circle, default, polygon, and rect. The format of the coords attribute depends on the value of shape. For circle, the value is x,y,r where x and y are the pixel coordinates for the center of the circle and r is the radius value in pixels. For rect, the coords attribute should be x,y,w,h. The x,y values define the upper-left-hand corner of the rectangle, while w and h define the width and height respectively. A value of polygon for shape requires x1,y1,x2,y2,... values for coords. Each of the x,y pairs define a point in the polygon, with successive points being joined by straight lines and the last point joined to the first. The value default for shape requires that the entire enclosed area, typically an image, be used.

Note: It is advisable to use the usemap attribute for the img element and the associated map element to define hotspots instead of the shape attribute.

tabindex
This attribute uses a number to identify the object's position in the tabbing order for keyboard navigation using the TAB key.
target
This attribute specifies the target window for a hypertext source link that references frames. The information linked to target will be displayed in the named window. Frames and inline frames must be named to be targeted. There are, however, special name values. These include _blank, which indicates a new window; _parent, which indicates the parent frame set containing the source link; _self, which indicates the frame containing the source link; and _top, which indicates the full browser window.
type
This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see http://www.w3.org/TR/html4/references.html#ref-MIMETYPES.
urn
This supposedly Microsoft-supported attribute relates a uniform resource name (URN) with the link. While it is based on standards work years back, the meaning of URNs is still not well defined, so this attribute is meaningless.


[編集] Example

    <!-- anchor linking to external file -->
    <a href="http://www.mozilla.com/">
    External Link
    </a>

[編集] Result

External Link

[編集] Notes

The following are reserved browser key bindings for the two major browsers and should not be used as values to accesskey: a, c, e, f, g, h, v, left arrow, and right arrow.

HTML 3.2 defines only name, href, rel, rev, and title.

The target attribute is not defined in browsers that do not support frames, such as Netscape 1 generation browsers.

The target attribute is not defined in browsers that do not support frames, such as Netscape 1 generation browsers. Furthermore, target is not allowed under strict variants of XHTML but is limited to frameset or transitional forms.


HTML 要素
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
(簡易リンク: HTML 要素クロスリファレンス, HTML カテゴリ)