-1
我試圖格式化DIV中的文本,但是我也想對DIV進行樣式設置。CSS在輸入樣式文本時沒有正確設計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的背景顏色不適用於文本背後?
(請記住我是很新的編碼,這個網站!)
'#FFF'或'#FFFFFF'指的是白!改變顏色請參閱[這裏](http://jsfiddle.net/RRH7G/1/) –
這可能是因爲你將白色背景應用到你的'h1'和你的'div'。 #FFFFFF是白色的顏色值,你可以在這裏發現十六進制顏色http://www.colorpicker.com/ – Luke
白色,白色,美麗。就像那樣會顯示。 –