私は正しく動作しようとしている次のコードを持っています:
<div id="newspost_bg">
<article>
<p>
<header><h3>The fast red fox!</h3></header>
This is where the article resides in the article tag. This is good for SEO optimization.
<footer>Read More..</footer>
</p>
</article>
</div>
<div id="newspost_bg">
hello
</div>
<div id="newspost_bg">
hello
</div>
<div id="advertisement">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2139701283631933";
/* testing site */
google_ad_slot = "4831288817";
google_ad_width = 120;
google_ad_height = 600;
//-->
</script>
</div>
これに付随するcssは次のとおりです。
#newspost_bg{
position: relative;
background-color: #d9dde1;
width:700px;
height:250px;
margin: 10px;
margin-left: 20px;
border: solid 10px #1d2631;
float:left;
}
#newspost_bg article{
position: relative;
margin-left: 20px;
}
#advertisement{
float: left;
background-color: #d9dde1;
width: 125px;
height: 605px;
margin: 10px;
}
私が経験している問題は、設定しようとしている広告が newspost_bg の id を持つ最後の広告と一致することですが、広告が入っているコンテナーの上部に合わせようとしています。これで十分な情報かどうかわかりません、そうでない場合は、何が必要か教えてください。Web コーディング シーンは初めてなので、あらゆる批評が役に立ちます。