简体   繁体   English

复杂的按钮精灵

[英]Complicated button sprite

I have this sprite: 我有这个精灵:

Link http://gpanel.darrell.nl/images/derma.png 链接http://gpanel.darrell.nl/images/derma.png

And in the right upper corner there are 4 button images. 在右上角有4个按钮图像。 I like to use the buttons like that the corners stay intact but that the rest can be stretched. 我喜欢使用按钮,例如,角保持原样,但其余部分可以拉伸。 I searched the whole internet but couldn't find a thing. 我搜索了整个互联网,但找不到任何东西。 How can I make this possible with CSS? 如何使用CSS做到这一点?

The same for the windows frame upper left. 左上方的窗框也一样。

Unfortunately border-image doesn't work well with sprites, It can be done, but requires an extra element and some not-very-elegant tricks, here's a demo: http://jsfiddle.net/sandro_paganotti/H2xgQ/1/ 不幸的是,边框图像不适用于sprite,可以做到,但是需要额外的元素和一些不太优雅的技巧,下面是一个演示: http : //jsfiddle.net/sandro_paganotti/H2xgQ/1/

.border{
    border-right: 400px solid black; 
    border-bottom: 400px solid black;
    border-image: url('http://gpanel.darrell.nl/images/derma.png') 3 388 388 3 fill stretch stretch;
    height: 300px;
    width: 200px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM