嗯..我的英語不是很好,所以我畫我想要什麼..調整窗口大小廣告的div保持在同一個地方
綠色容器這是我的內容包。黑色和紅色正方形,是一些按鈕來訪問另一個頁面。
所以當我調整頁面大小,我想保持畢業論文按鈕的這樣的圖像:
1,024像素的窗口視圖:http://d-3.me/1024.jpg
這是我最初的HTML:
<div id="wrap_home_bts">
<div class="bt_woman"></div>
<div class="bt_man"></div>
</div>
這是我的css:
#wrap_home_bts{
position:relative;
width:100%;
height:100%;
}
.bt_woman{
width:880px;
height:389px;
background:#FFCC00;
position:absolute;
left:0;
bottom:245px;
}
.bt_man{
width:733px;
height:168px;
background:#CC00FF;
position:absolute;
right:0;
bottom:74px;
}
但這樣, 「按鈕」伴隨着調整大小的窗口。
我清楚嗎?
看看媒體查詢:css-tricks.com/css-media-queries – gaynorvader
你是否試圖設置bt_woman和bt_man的寬度而不是px中的%? –
@WillemVanBockstal以%爲單位的設置寬度不會帶來任何效果。 – 2014-12-09 06:56:01