如何模拟在asp.net web应用程序图像按钮的视觉推 [英] How to simulate visual push for image button in asp.net web application
问题描述
我开发一个asp.net web应用程序和我有一些图像按钮控件,我怎么可以模拟它的视觉点击?我的意思并不是触发事件,只是视觉上看到,该按钮被按下像正常的按钮做的,谢谢
I'm developing an asp.net web application and I have some image button controls, how can I simulate the visual clicking of it? I don't mean triggering the event, just visually seeing that the button is pushed like normal buttons do, thanks
推荐答案
您可以使用CSS标签。请参阅本livedemo: http://img.usabilitypost.com/0812/active_button/index.html
You can use css tags. See this livedemo: http://img.usabilitypost.com/0812/active_button/index.html
在这里说明:的http:/ /www.usabilitypost.com/2008/12/16/$p$pssed-button-state-with-css/
编辑:在code为方便起见
The code for ease's sake.
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Button Test</title>
<style type="text/css" media="screen">
body {
padding: 40px;
}
#button {
display: block;
width: 135px;
height: 43px;
background: url(button.png) no-repeat top;
}
#button:active {
background: url(button.png) no-repeat bottom;
}
</style>
</head>
<body>
<a id="button"></a>
</body>
另外,如果你是非常新的CSS和真的不希望重塑你可以使用一个CSS基地一样的界面Twitter的引导轮:的 http://twitter.github.com/bootstrap/base-css.html#buttons
Also, if you're extremely new to CSS and don't really want to reinvent the wheel you could use a base css interface like Twitter's Bootstrap: http://twitter.github.com/bootstrap/base-css.html#buttons
这篇关于如何模拟在asp.net web应用程序图像按钮的视觉推的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!