网页上有很多功能是通过链接方式传递参数,这种功能链接普通样式就是一个超链接 退出,如果将超链接的样式变成按钮样式,给用户的感觉会更好。

一种方法是给a标签添加display:block的样式,并添加hover样式。

 

<style type="text/css">
div.container
{
width: 600px;
/*height: 200px;*/
border-bottom: 2px solid green;
padding: 10px;
}
.container a,.container a:link,.container a:visited
{
display: block;
float: left;
margin-right: 5px;
background: #ED2B34;
padding: 5px;
text-decoration: none;
font-size: 12px;
font-family: '宋体';
color:#fff;
}
.container a:hover
{
display: block;
float: left;
margin-right: 5px;
background: #C30A13;
padding: 5px;
text-decoration: none;
font-size: 12px;
font-family: '宋体';
color:#ccc;
}
.clear
{
clear: both
}
</style>
<div class='container'>
<p>微信公众平台开发(2)扫描二维码添加公众账号</p>
<a href="http://www.cnblogs.com/birdskyws/p/3912719.html">跳转链接1</a><a href="http://www.cnblogs.com/birdskyws/p/3910493.html">跳转链接2</a>
<div class="clear"></div>
</div>

 

普通样式:

hover样式:

 


转自:http://www.cnblogs.com/birdskyws/p/3914472
  • 你为什么不重复使用你的代码复选框? 试试这个 - > $('#toneclass').change(function(){ toggle(this.checked) }); function toggle(toggle) { var c = toggle ? 'red' : ''; $('.high').css('color', c); var c = toggle ? 'green' : ''; $('.mid').css('color', c); var ...
  • jQuery UI按钮启用和禁用可以调用以启用或禁用按钮的方法: $("#mybutton").button("enable"); // or .button("disable"); jQuery UI buttons have enable and disable methods that you can call to enable or disable the button: $("#mybutton").button("enable"); // or .button("disable");
  • 不幸的是,问题的简单答案是否定的。 没有办法影响按钮的原生样式以显示按下。 The simple answer to your question is, unfortunately, no. There's no way to affect the native style of a button to appear pressed.
  • 单选按钮是Shadow DOM的一部分,但它不能在浏览器中进行普遍的样式设置。 目前获得自定义单选按钮的最佳方法是使用图像或复选框黑客 。 虽然如果你只是想给它一个绿色边框,你也可以使用伪元素 ,它可能看起来像这样: input[type=radio]:after { display: block; width: 100%; height: 100%; border: 1px solid green; content: ""; } 如果你想要这个边框是圆的,你可以使用border-ra ...
  • 我认为SL论坛上的这个答案就是你一直在寻找的。 I think this answer on SL forum is what you've been searching for.
  • 这个怎么样: