2012-12-19 17 views
2

我是來自比利時的學生。我正在創建我的投資組合網站,並且遇到了我無法修復的錯誤 。我的老師建議我在這裏發表問題尋求幫助。HTML和CSS的文本位置不能更改

正如你可以大膽的文字怪怪的截圖中看到。它應該像下面的文本部分一樣。 有什麼辦法解決這個問題嗎?

http://imgur.com/aYiYu

HTML

<div id="content"> 
<div class = "intro" id="introtext"> 
<h2 id="h2intro">My name is not Joren and I am a <span class="cyan">designer</span>  from Belgium. </h2> 
<h3 class="h3intro">I am passionate about making very <span class="cyan">simple and clean</span> designs that are easy on the eye and very simple to use.</h3> 
</div><!--end intro--> 

CSS

.cyan 
{ 
    color:#00d1e0; 
} 

#h2intro 
{ 
    font-weight: bold; 

} 

.h3intro 
{ 
    color: #463E3F; 
} 

提前感謝!

淨蓮

+0

第一,你爲什麼要使用一個頭的ID(#h2intro)和其他(.h3intro)一類? – james31rock

+5

你的老師是非常明智的,你在這裏發,我想補充 – Luke

+0

正常工作對我來說:http://jsfiddle.net/RJxBy/ – Luke

回答

1

我想你需要更改默認字體大小兩個H2和H3的尺寸相同。嘗試

h2, h3 { 
     font-size:14px; 
} 

#h2intro { 
    font-weight: bold; 

} 

.h3intro { 
    color: #463E3F; } 

我相信你已經設置爲H2和H3的默認樣式。這就是爲什麼你看到填充和尺寸差異。如果您不想影響其他h2和h3標籤,您還可以在#h2intro和.h3intro中設置尺寸。

迴應評論,請使用以下樣式在樣式表的底部。

#introtext h2.h2intro 
{ 
    font-size: 14px; 
    font-weight: bold; 
    margin: 0px; 
    padding: 0px; 
} 

#introtext h3.h3intro 
{ 
    font-size: 14px; 
    margin: 0px; 
    padding: 0px; 
    color: #463E3F; 
} 
+0

還是同樣的問題:( –

+0

你們有H2和H3低於.h3intro定義的樣式?如果是的話,這些樣式將覆蓋我提供的H2和H3風格 – james31rock

+0

#introtext 。{ \t背景顏色:白色; 填充底:20像素; } #introtext H2 { 文本對齊:左; 字體大小:部18px; 保證金左:25像素; 填充頂:20像素; 填充右:25像素; } #introtext h3 { text-align:left; font-size:15px; margin-left:25px; padding-top:20px; padding-right:25px; } –