-1

これは私が今までに経験したことのないことです。私の div の高さが CSS と連携しておらず、ページの流れ全体を台無しにしています。div は中央に配置され、幅 960 ピクセル、高さ約 1000 ピクセル、下部に 150 ピクセルのパディングが配置され、フッターから分離されます。

ウェブサイトのリンク: http://tinyurl.com/b8vvhgr

HTML

<div id="energyrating-desc">

<h1><span class="gray">Energy Audit Services</span></h2>

<img src="/nd/images/yellow-bar.jpg" width="960" height="2" style="padding-bottom:2px;"></img>

<p>According to the EPA Energy Star program, the average American household spends $1,500 annually on
energy bills - a number that may go up as much as 50% this year.
</p>

<br>

<p>Almost half of that energy goes to heating and cooling your home. Lighting and appliances represent about a
quarter of those costs. Each of us can take action today to reduce energy use at home, while still staying
comfortable.
</p>


<br>

<p>Let New Day Homes perform a top-to-bottom Energy Audit of your home to help determine the cause of any
problems you may be experiencing, help you gauge your home's energy efficiency, and recommend clear
steps you can take to reduce your energy bills.</p>

<br>

<p><b>Energy Audit</b></p>
<p>
Find out where you can save on energy costs by having a full energy audit done on your home.
</p>

<br>

<p><b>New home Certified Energy Ratings</b></p>
<p>
Performed for builders and home buyers.
</p>

<br>

<p><b>Ratings for Builder Tax Credit</b></p>

<br>

<p><b>Energy STAR Ratings</b></p>

<br>

<p><b>IECC-2009 Testing</b></p>
<p>
Blower door testing, insulation inspections, and pre-verification to meet the IECC-2009
Energy Code requirements.
</p>



</div>

CSS

/*Energy Description*/

#energyrating-desc {    
    padding-bottom: 150px;
    width: 960px;
    height: 670px;
    margin-left: auto; 
    margin-right: auto;
}

大変お世話になりました。

4

3 に答える 3

2

私はあなたのcssソースを調べました。あなたのテイクhtmlアルックに終了タグがあります.css

body {
    /*background: url(/nd/images/bgtop.png), url(/nd/images/bg.jpg);
    background: url(/nd/images/bgtop.jpg)\9; /* IE 8 and below */ 
    background-repeat: repeat-x\9; /* IE 8 and below */ 
    background-repeat: repeat-x, repeat;*/
    color: #000000;
    font-size:14px;
    font-family: sans-serif;
}

</body>

を削除します

</body>

そして、私energyrating-descはあなたのcssのどれにも表示されません

編集:

念のため、firebugでもチェックしましたenergyrating-descが、cssで指定していませんでした....

于 2012-11-10T17:19:48.387 に答える
0

適切なマージンを割り当てて、中央に div を作成します。

margin:0 auto;

#energyrating-desc {    
    padding-bottom: 150px;
    width: 960px;
    height: 670px;
    margin:0 auto;
}
于 2012-11-10T17:18:33.493 に答える
-1

開発者ツールのトレース スタイル パネルを確認しましたが、div 要素にスタイル属性が適用されていません。また、ウェブサイトの css ファイルに「energyrating-desc」という名前のスタイル ID が見つかりませんでした?! どこで定義しましたか?結局、 の html 応答に"energy.php"複数の"html"タグがあり、構造が正しくないことがわかりました。css スタイルのバグを探す前に、まずこれを行う必要があります。

HTML ドキュメントには、 という名前"html"の 1 つのルート タグ、その中に という名前の 1 つのタグ"body"、および必要に応じて、"head"css リソースとメタ タグまたはクライアント スクリプトを含めるための名前のタグが必要です。間違ったタグが 1 つでも (閉じていない、書き方が悪いなど)、見たことのない信じられないほど多くのレイアウトが発生する可能性があります。

乾杯

于 2012-11-10T17:17:12.647 に答える