2013-04-25 72 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

相关问题