DIV 内のテキストをフォーマットしようとしていますが、DIV のスタイルも設定したいと考えています。
PHP ページには、DIV とテキストがあります。
<div id="main-content">
<h1>Welcome to the Drug Debate!</h1>
<p>Home of facts and deabtes of legal and illegal drugs!The Drug debate offers a safe and relaxed enviroment where you will be able to find information and facts about different types of drug </p>
</div>
次に、CSS で、次を使用してその DIV のスタイルを設定しようとしています。
#main-content{
background-color: #FFFFFF;
width:600px;
height: 350px;
margin: 0 auto;
border:solid;
}
および<h1>
使用<p>
:
h1 {
font-family:"Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
font-size:24px;
padding-left:200px;
}
(および についても同様<p>
)
これは、DIV の背景色がテキストの背後に適用されないなどの問題を引き起こしていますか?
(私はコーディングとこのサイトにまったく慣れていないことを覚えておいてください!!)