兩個箭頭我想用CSS只我如何在CSS
實例創建一個箭頭就可以看到http://jsfiddle.net/b9Yfc/
在
<div id="arrow"><div id="arrow-inner"></div></div>
我想arrow-inner
會的地方變成arrow
和結果應該像
如何實現我的目標?
兩個箭頭我想用CSS只我如何在CSS
實例創建一個箭頭就可以看到http://jsfiddle.net/b9Yfc/
在
<div id="arrow"><div id="arrow-inner"></div></div>
我想arrow-inner
會的地方變成arrow
和結果應該像
如何實現我的目標?
播放與position
性質
在#arrow
添加position: relative;
而且在#arrow-inner
添加position: absolute; top:-16px; left:-15px;
而且normaly它的作品。見我http://jsfiddle.net/DoubleYo/cAGWa/
謝謝! @DoubleYo喲!呦!真棒! – haha 2011-04-06 11:58:08
#arrow {
position: relative;
background: // the larger image
width: // width of larger image
height: // height of larger image
}
#arrow-inner {
position: absolute;
background: // the smaller image
width: // the width of smaller image
height: // the height of smaller image
top: // the offset from the top of the larger image e.g. 2px
left: // the offset from the left of the larger image e.g. 5px
}
,你可以使用你的造型
#arrow {
position: relative;
background: url('url of the bigger image');
}
#arrow-inner {
position: absolute;
background: url('url of the smaller image');
top: ;//dimmension in px for the vertical top displacement
left: ;//dimmension in px for the vertical left displacement
z-index:; dimmension in px for the z displacement though not neccessary
}
您使用的是相同的ID兩次在您的示例如下。注意不要在你的真實生活版本中這樣做,而應該使用類。 – RoToRa 2011-04-06 11:49:55
@RoToRa是的..將使用真正的網站上的類:)謝謝 – haha 2011-04-06 11:52:33