アプリ版:「スタンプのみでお礼する」機能のリリースについて

css勉強し始めた初心者なので、説明やソースなどめちゃくちゃだと思いますが、教えてください。

固定ヘッダー(常に画面の上にヘッダーがあるように)を作成し、その下に画像を配置したのですが、ヘッダーの下にその画像が入り込んでしまいました。ヘッダーの下に重ならず配置するにはどうすればよいでしょうか?
よろしく御願いいたします。

body内に
<div id="header">
<h1><a href="/" title="website"></a></h1>
<img src="img/b01.gif" width="108" height="68" border="0"
onmouseover="this.src='../ao/img/b01-.gif"
onmouseout="this.src='../ao/img/b01.gif">
<img src="img/b02.gif" width="88" height="68" border="0"
onmouseover="this.src='../ao/img/b02-.gif'"
onmouseout="this.src='../ao/img/b02.gif'">
<img src="img/b03.gif" width="59" height="61" border="0"
onmouseover="this.src='../ao/img/b03-.gif'"
onmouseout="this.src='../ao/img/b03.gif'">
<img src="img/b04.gif" width="50" height="68" border="0"
onmouseover="this.src='../ao/img/b04-.gif'"
onmouseout="this.src='../ao/img/b04.gif'">
<img src="img/b05.gif" width="39" height="68" border="0"
onmouseover="this.src='../ao/img/b05-.gif'"
onmouseout="this.src='../ao/img/b05.gif'">
<img src="img/b06.gif" width="80" height="68" border="0"
onmouseover="this.src='../ao/img/b06-.gif'"
onmouseout="this.src='../ao/img/b06.gif'">
<img src="img/b07.gif" width="51" height="68" border="0"
onmouseover="this.src='../ao/img/b07-.gif'"
onmouseout="this.src='../ao/img/b07.gif'">
<img src="img/b08.gif" width="47" height="68" border="0"
onmouseover="this.src='../ao/img/b08-.gif'"
onmouseout="this.src='../ao/img/b08.gif'">
<img src="img/b09.gif" width="54" height="68" border="0"
onmouseover="this.src='../ao/img/b09-.gif'"
onmouseout="this.src='../ao/img/b09.gif'">
<img src="img/b10.gif" width="125" height="68" border="0"
onmouseover="this.src='../ao/img/b10-.gif'"
onmouseout="this.src='../ao/img/b10.gif'">
</div>
<h2><img src="img/panichi.gif" alt="TOP" width="700" height="450" class="centering" /></h2>

A 回答 (1件)

肝心のCSS部分が書かれていませんが、.headerでposition: absoluteを指定しているのではないかと推測。


絶対位置指定の要素は、他の要素の相対位置に関与しません。そのため、前後に重なった状態になります。ご質問のソースだと、<h2>がページトップに配置されます。

<h2 style="padding-top: 68px">
などとして、ページ最上部にヘッダ分の余白を確保してください。
    • good
    • 1
この回答へのお礼

Wizard_Zero様

ありがとうございます!
これだけの情報で推測していただいたとおり、
教えていただいたとおりするときちんと見れるようになりました!
本当にありがとうございます!

お礼日時:2009/11/28 18:53

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