dポイントプレゼントキャンペーン実施中!

画像にオンマウスで背景を水平方向+上に固定するにはどうしたら良いのでしょうか?
今現在使用しているタグだと垂直水平方向に繰り返しになってしまいます。


使用しているソースは以下のとおりです。
----------------------------------
</HEAD>
<BODY>
<TABLE cellspacing="0">
<TBODY>
<TR>
<TD onmouseover="body.style.background='url(/image/001.jpg) fixed repeat';" onmouseout="body.style.background='';"><IMG src="/image/001.jpg" width="200" height="200" border="1"></TD>
</TR>
<TR>
<TD onmouseover="body.style.background='url(/image/002.jpg) fixed repeat';" onmouseout="body.style.background='';"><IMG src="/image/002.jpg" width="200" height="200" border="1"></TD>
</TR>
<TR>
<TD onmouseover="body.style.background='url(/image/003.jpg) fixed repeat';" onmouseout="body.style.background='';"><IMG src="/image/003.jpg" width="200" height="200" border="1"></TD>
</TR>
</TBODY>
</TABLE>
</BODY>
</HTML>
----------------------------------

「fixed repeat';」を「fixed repeat-x';」に変えてみても変化なしでした。

また、styleに
<!--
BODY {
background-attachment: fixed;
background-repeat: repeat-x;
background:position:top}
-->
を書いてみたりもしたのですが変化なしでした。

ご存知の方、詳しい方アドバイスお願いします。

A 回答 (1件)

fixed は、background-attachmentの属性で、スクロールに関するものです。


topが、background-positionの属性です。

3箇所の「fixed repeat」を「top repeat-x」に替えればよいはずです。

また
<!--
BODY {
background-attachment: fixed;
background-repeat: repeat-x;
background:position:top}
-->
では、
background:position:top}
がおかしいですね。
background-position:top}
です。このとき画像は指定していましたか。
    • good
    • 0
この回答へのお礼

styleにはなにもいれず「fixed repeat」を「top repeat-x」にしたところ水平方向+上に固定されました!!!!

的確及び素早い回答ありがとうございました^^

お礼日時:2008/04/09 12:33

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!