2013-04-25 122 views

回答

1

我不確定你想要完成什麼,但我想說你只需要使用百分比作爲寬度。事情是這樣的HTML:

<html> 
    <head> 
    </head> 
    <body> 
     <div id="wrapper"> 
      <img src="foo/bar.jpg" /> 
      <div id="content"> 
      </div> 
     </div> 
    </body> 
</html> 

這對CSS:

*, html, body { 
    margin: 0px; 
    padding: 0px; 
} 

#wrapper { 
    width: 900px; 
    margin: 0px auto; 
} 

img { 
    width: 100%; //Sets the image width to 900px 
} 

#content { 
    width: 100%; //Sets the content divs width to 900px 
} 

這是一個答案,我認爲這個問題是。如果不是,請告訴我。

+1

Hi Dreamonic,非常感謝。這有助於解決我的問題..... – KMC 2013-04-28 05:57:06

+0

沒問題,很高興我可以幫忙! – 2013-04-28 18:04:50