• ベストアンサー

background-imageが表示されない

ヘッダーの部分の背景画像が表示されません。 CSS #header { height: auto; display:block; margin:0px;padding:0px;width:100%; background-image: url(../images/mainback.png); } HTML <div id="header"> <div><img src="images/topbar2.gif" alt="" usemap="#map2" border="0" /></div> <map name="map2"> <area href="s.html" alt=""shape="rect"coords="394,57,495,68" /> <area href="t.html" alt=""shape="rect"coords="510,57,605,68"/></map> <div><img src="images/main.png" alt="" usemap="#map1" border="0" /></div> </div> 上記のようにヘッダー画像の下に背景画像をつけたいのですが、画像がある場合背景画像は重ならないんでしょうか?

  • HTML
  • 回答数2
  • ありがとう数2

質問者が選んだベストアンサー

  • ベストアンサー
  • 15mm
  • ベストアンサー率65% (65/100)
回答No.2

背景として同じ場所に別画像を表示するなら、 前景(背景でないほう)の画像の透明にしたいところに透過色が設定されている必要があります。 images/topbar2.gif images/main.png に透過色が設定されているか確かめてください。

kurobon619
質問者

お礼

15mmさん、なるほど透過色ですか、ありがとうございます。

その他の回答 (1)

  • naokita
  • ベストアンサー率57% (1008/1745)
回答No.1

どこに画像を置いているのかわかりませんが、 (../images/mainback.png) ↓ (images/mainback.png) で、どうですか? 他は、"images/topbar2.gif" "images/main.png" なっていますけど・・・ ----------------------------- それと、 border="0" /> ここに  ↑ 全角スペースがあるので半角スペースにしましょう・・・

kurobon619
質問者

補足

naokitaさん 説明が不足してすみません。 css/basic.css images/mainback.png という階層になっております。例ではここは修正するべきでした。 逆に言うとこれ以外のところは大丈夫ということでしょうか?

関連するQ&A

  • mapが機能しない

    以下のようにmapを設置しましたが、全く機能しません。何が考えられるでしょうか? <div><img src="images/head.jpg" alt="" usemap="#map" border="0"/></div> <map name="map"> <area href="kan.html#3" alt="" shape="rect" coords="0,3,105,154" /> <area href="kan.html#2" alt="" shape="rect" coords="314,3,393,154" /> <area href="kan.html#1" alt="" shape="rect" coords="106,3,211,146" /> </map>

    • ベストアンサー
    • HTML
  • mapでロールオーバー

    以下のようにmapでロールオーバーをしようとしたのですが、機能しません。 <div align="center"><img src="images/main.png" alt="" usemap="#map1" border="0" /></div> <map name="map1"> <area href="taku.html" alt="" shape="rect" coords="766,0,996,69" onmouseover="this.src='images/mainleft1_on.png'" onmouseout="this.src='images/mainleft1.png'" src="images/mainleft1.png" alt="" border="0" /> <area href="taku2.html" alt="" shape="rect" coords="766,70,996,137" onmouseover="this.src='images/mainleft2_on.png'" onmouseout="this.src='images/mainleft2.png'" src="images/mainleft2.png" alt="" border="0"/></map> 全体の画像main.png の上にボタンmainleft1.png mainleft2.png がロールオーバーするようにしたいんですができないんでしょうか?

    • ベストアンサー
    • HTML
  • IE6でヘッダーとイメージの間に微妙な隙間

    ヘッダーとンイメージはそれぞれdivで囲んでいます。IE6でヘッダーとメインイメージの間に微妙な隙間が隙間が空いてしまいます。FOXでは隙間は空きません。なぜでしょうか? 教えてください。 ==HTML== <div id="header"><img src="images/head.gif" width="821" height="161" border="0" usemap="#Map2" /> <map name="Map2" id="Map2"> <area shape="rect" coords="674,124,775,144" href="#" /><area shape="rect" coords="36,17,322,85" href="#" /> </map></div> <div id="main_img" align="center"><img src="images/main_flash.jpg" width="801" height="305" border="0" /></div> ==css== /*==ヘッダー関係==*/ #header img{ margin:0 0 0 0; padding:0; height:161px; } /*============ボディ部分開始============*/ #main_img{ background:url(../images/main_flash_bg.jpg) no-repeat; width:821px; height:305px; margin:0; padding:0; }

    • ベストアンサー
    • HTML
  • 吹き出しに画像とコメントを入れるプログラム

    下記のプログラムで吹き出しを作成して 画像とコメントを表示したいのですが なかなか出来ず困っております。 方法がありましたらよろしくお願いいたします。 <img src="画像名" usemap="#map" border="0"> <map name="map"> <area shape="rect" coords="305,60,390,126" href="アドレス" alt="北海道"> <area shape="rect" coords="288,151,331,181" href="アドレス" alt="青森"> <area shape="rect" coords="280,181,311,221" href="アドレス" alt="秋田"> <area shape="rect" coords="310,181,341,221" href="アドレス" alt="岩手"> <area shape="rect" coords="275,221,305,245" href="アドレス" </map>

  • map が機能しない

    <div><img src="images/topbar.gif" alt="" usemap="#map2" border="0" /></div> <map name="map2"> <area href="site.html" alt="" shape="rect"coords="394,57,495,68" /> <area href="toi.html" alt="" shape="rect" coords="510,57,605,68" /> </map> 上記のようにリンクを画像上に設置しましたが、IE6では機能しませんでした。 原因はalphafilter.jsというジャバスクリプトを使用していたからです。、これはサイトの外枠に影を入れるため、透過png の画像を使用したいためです。透過pngをIE6で有効にするためにalphafilter.js を使ったわけす。 mapを機能させるためにはalphafilter.jsを外さなければなりません。 IE6で外枠の影、map両方を機能させる良い方法はないでしょうか? CSSハックでIE6のみ透過gifを使うという方法はとりたくないです。何故なら透過gifは画像が粗いからです。

    • ベストアンサー
    • HTML
  • map初心者です

    名前の付け方がわかりません。 なんでもいいのでしょうか?とりあえずわからないので画像名と同じ名前に設定しました。 また、下の記述が全部なのですが画像しかアップされません。 リンクすらなりません。 どこがおかしいのでしょうか。よろしくお願いします。 <img src="img/1.jpg" usemap="#1map" border="0"> <map name="1map">  <area shape="rect"   coords="220,148,179,200"   href="http://12345" alt="**" target="_blank">  <area shape="rect"   coords="358,125,181,126"   href="http://12345" alt="**" target="_blank">  <area shape="rect"   coords="167,336,178,141"   href="="http://12345" alt="**" target="_blank">  <area shape="rect"   coords="178,338,180,214"   href="="http://12345" alt="**" target="_blank"> </map> 関係あるかわかりませんが、使っているのはロリポップです。

    • ベストアンサー
    • HTML
  • クリッカブル・マップのリンクが効かない

    下記のコードでpngの画像上でリンクをつけましたが、カーソルをかざしても反応が有りません。どこが間違っているのでしょうか? 皆様、ご教授お願いします <table width="750" align="center"> <tbody> <tr><td> <img src="top2.png" usemap="#top2"> <map name="top2"> <area shape="rect" coords="20,197,63,206" href="http://------.html" alt="A"> <area shape="rect" coords="78,198,121,206" href="http://------.html" alt="b"> <area shape="rect" coords="137,198,181,206" href="http://------.html" alt="c"> <area shape="rect" coords="196,198,239,206" href="http://------.html" alt="d"> <area shape="rect" coords="19,163,63,272" href="http://------.html" alt="e"> <area shape="rect" coords="77,264,121,272" href="http://------.html" alt="f"> </map> </td> </tr> </tbody> </table>

    • 締切済み
    • XML
  • テーブル内の行の間に隙間ができてしまいます

    いつもお世話になります。 dreamweaverCS2でホームページを作っています。 2行1列のテーブル内のセルそれぞれに画像を配置しているのですが、 IE6で表示すると、行(画像)と行(画像)の間にスペース(白い)ができてしまい、 画像同士がくっつきません。 上の行にはイメージマップを使用しています。 なんとか画像をくっつけた状態で表示したいのですが、どこに問題があるでしょうか。 画像の大きさは上の行のものが742*69 下のものが742*18です。 ちなみにHTMLは下記のようになります。 また、Netscape7.1やsafariではくっついた状態で表示できます。 困っています。よろしくお願いします。 *****以下HTML************ <table border="0" cellpadding="0" cellspacing="0" width="742" > <tr> <td width="742" > <img src="images/header1_1.gif" alt="" width="742" border="0" usemap="#hd1_Map" vspace="0"/> <map name="hd1_Map"><area shape="rect" coords="260,50,366,65" href="index.html" alt="Homeへ" /> <area shape="rect" coords="367,50,475,65" href="about.html" alt="***について" /> <area shape="rect" coords="476,50,590,65" href="members.html" alt="****一覧" /> <area shape="rect" coords="591,50,700,65" href="syukketsu.html" alt="***" /> </map></td> </tr> <tr> <td><img src="images/subnavibar1.gif" alt="" width="742" border="0" vspace="0" /></td> </tr> </table> ****ここまで****

  • イメージマップで文章を表示したい。

    下記の例のように、「map.gif」という画像の各箇所ごとにそれぞれのリンクを貼るのは下記の方法で出来ると思うのですが、 「coords="22,11,122,62"」にマウスが乗ったときに指定した箇所に文章を表示するにはどうしたらよいのでしょうか? ※それぞれの箇所によって、それぞれ違った文章を表示したいです。 ※「map.gif」という画像が表示されている上段(下段でもOK)に枠を作って、その中に説明文が表示される仕組み。 <img src="map.gif" alt="サンプル" usemap="#sample"> <map name="sample"> <area shape="rect" coords="22,11,122,62" href="map1.html" alt="リンク1"> <area shape="circle" coords="184,86,30" href="map2.html" alt="リンク2"> <area shape="poly" coords="87,78,30,110,81,139,69,113" href="map3.html" alt="リンク3"> <area shape="default" href="map4.html" alt="リンク4"> </map> 宜しくお願いします。

    • ベストアンサー
    • HTML
  • クリッカブルマップのリンクが‥

    クリッカブルマップでリンクさせたくて、記述いたしましたが、リンクが有効になっていません。 ブラウザ上では画像表示のままでハイパーリンクになっておらず、目的のページへ行けない状態です。 これは何が原因でしょうか。 以下、htmlの記述です。みなさま、どうかご教授のほどお願いします。 <img src="./images/menu1.jpg" usemap="#linkmap" border="0" height="81" width="500"> <map name="linkmap"> <area shape="rect" coords="x15,y22,x88,y53" href="$home" alt="ホーム"> <area shape=rect coords="x88,y22,x203,y53" HREF="http://"> <area shape=rect coords="x201,y22,x310,y53" HREF="./index.cgi?mode=top"> <area shape=rect coords="x309,y22,x418,y53" HREF="http://"> </map>