這可以用一些CSS來實現:
HTML
<div id="container">
<div id="left"></div>
<div id="middle"></div>
<div id="right">
<img src="http://www.thegardenhelper.com/pixpg/graphics/sammy.jpg" />
</div>
</div>
CSS
/*You want to make sure the document is set to the fullscreen width*/
html, body {
width : 100%;
height : 100%;
}
/*Set the container div to the full size of the document and set its position to something other than `static` so its children will take their position relatively from it*/
#container {
width : 100%;
height : 100%;
position : relative;
background : black;
}
/*absolutely position the left column to be 200px wide*/
#left {
position : absolute;
left : 0px;
top : 0px;
width : 200px;
height : 100%;
}
/*absolutely position the middle column to be 500px wide and start 200px from the left*/
#middle {
position : absolute;
left : 200px;
top : 0px;
width : 500px;
height : 100%;
background : blue;
}
/*absolutely position the right column to take the rest of the page starting from 700px from the left*/
#right {
position : absolute;
left : 700px;
top : 0px;
right : 0px;
height : 100%;
background : red;
}
/*set the image to 100% height and width to fill its container (#right)*/
/*alternatively you can set the width of the image to `auto` so it will scale with the aspect ratio intact but still take-up 100% of the page's height*/
#right > img {
width : 100%;
height : 100%;
border : none;
}
下面是上述解決方案的的jsfiddle:http://jsfiddle.net/jasper/7y9DZ/2/
什麼代碼,你到目前爲止?編輯你的問題以包含它,並且可以選擇[jsFiddle demo](http://jsfiddle.net/)。 – thirtydot
如果你發現某種方式來擴大高度的形象,它會看起來很扭曲。你想用圖像達到什麼目的?如果它的紋理或圖形,你可以嘗試使它成爲背景圖像並重復。 – WooHoo
這裏是我的設計http://www.fsdegrees.com/subpage.jpg我認爲Jasper解決方案將工作我會嘗試,但圖像可能會得到一點恢復,所以一些jquery可能需要 – jmysona