2013-04-04 53 views
0

看一看here为什么图像的一部分隐藏

当你点击一个瓷砖后,一个房子精灵应该贴在这个瓷砖上并完全显示。图像需要跨越多个图块但是,精灵将被相邻的图块覆盖。这是为什么?

.div { 
    background: none repeat scroll 0 0 red; 
    display: inline-block; 
    height: 20px; 
    width: 20px; 
    vertical-align:top; 
    transition: all 500ms ease-in-out; 
    cursor: url(house.png) 1 20, pointer; 
} 
+0

它涵盖的div的背景,右方和下方它 – 2013-04-04 17:16:39

+0

这怎么解决? – Dharman 2013-04-04 17:17:32

回答

2

这应该工作:

.div img { 
    position : absolute; 
} 
+0

但我想要图像跨越几个瓦片,而不仅仅是那一个 – Dharman 2013-04-04 17:18:18

+0

啊给图像'位置:绝对;'然后 – AlienWebguy 2013-04-04 17:19:05

+0

天才,这也可以实现使用溢出以及? – Dharman 2013-04-04 17:21:15

1

这是因为砖的尺寸20x20px - 这是比你的PNG小