Share via


background-position

background-position background-position *
*前のトピック: background-image
*次のトピック: background-repeat

background-position

解説

エレメントのバックグラウンド画像の最初の位置を指定する。

構文

{ background-position: [percentage | length]{1,2} | [top | center | bottom] || [left | center | right]}

注意事項

もしエレメントにバックグラウンド画像が指定されていない場合には何も行わない。

この属性は継承されない。

オブジェクトのx、y座標を指定する。

{background-position: 20px 40px}

バックグラウンド画像の上端を一番上の中央に配置する。

{background-position: top center}

適用

A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HTML, I, IMG, INPUT, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, S, SAMP, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP, INPUT type=button, INPUT type=file, INPUT type=reset, INPUT type=submit, INPUT type=text, INPUT type=image, INPUT type=checkbox, INPUT type=radio, INPUT type=password

スクリプトプロパティ

backgroundPosition, backgroundPositionX, backgroundPositionY

Up トップに戻る
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.