2012-04-20 182 views
0

所以這就是發生了什麼,你可以從下面的圖片中看到瀏覽器的屏幕尺寸使得女人在我稱之爲掩護或移動的時候。問題與位置:絕對;

這裏是我的代碼

img#woman{ 
    position:absolute; 
    bottom:100px; 
    display:block; 
    right:55%; 
    z-index: 900; 
} 
#homearea{ 
    display:block; 
    height:750px; 
} 

http://i.imgur.com/3A19L.jpgScreen Suze of Woman

我需要女人留在一個地方,她應該是這樣的

what she should look like

+4

添加HTML標記。 – steveax 2012-04-20 02:27:32

+0

顯示你的標記,以便更好地理解和更好的結果.... – 2012-04-20 07:18:55

+0

任何運氣與任何答案? – magzalez 2012-04-21 04:58:00

回答

1

這是沒有看到你的HTML :

嘗試將包含div(#homearea?)上的位置設置爲relative,然後將圖像的方向值更改爲相對於包含div的左上角。

換句話說,嘗試這樣的事情:

img#woman{ 
    position:absolute; 
    top:200px; 
    display:block; 
    left:-30px; 
    z-index: 900; 
} 
#homearea{ 
    position:relative; 
    display:block; 
    height:750px; 
} 
0

嗨,我想你可能是你使用的背景這個圖像作爲這樣

定義相對的Homearea ID位置和女人的ID給位置絕對給背景圖片,並設置爲左,右頂部底部根據您的佈局

由於這樣

級的CSS

#homearea{ 
position:relative; 

} 

#woman{ 
width:xxx; // width of your images 
height:xx; // height of your images 
    position:absolute; 
    bottom:100px; 
    right:55%; 
    z-index: 900; 
background:url('../../xxx.jpg') no-repeat 0 0; 
} 

HTML

<div id="homearea"> 
    <div id="woman"></div> 
    </div> 
0

我想你應該定義現在的位置是:相對的;至您的父分區position:absolute;兒童事業部希望這會工作......

img#woman{ 
    position:absolute; 
    bottom:100px; 
    display:block; 
    right:55%; 
    z-index: 900; 
} 
#homearea{ 
    height:750px; 
    position:relative; 
}