2013-09-26 30 views
0

我有一張圖像,我想從一個div後面「偷看」:圖像的左半部分從div後面窺視,其餘部分隱藏 - 像this位置圖像如此左半部分可見,右半部分位於div後面

的div有以下CSS:

#div{ 
    float: left; 
    position: relative; 
    margin-left: 5%; } 

因爲我已經嘗試使用了速覽者:

#peeker { 
    position: fixed; 
    margin-left: 2.5%; 
} 

然而,這隻能在變焦爲100%。當我縮小時,#peeker不再顯示50%。

有沒有可能做到這一點,而不使用JavaScript?

回答

0
#peeker { 
    position: fixed; 
    margin-left: 2.5%; 
    width: 5%; 
}