如何使 html 链接看起来像一个按钮?
问题描述:
我使用的是 ASP.NET,我的一些按钮只是做重定向.我宁愿它们是普通的链接,但我不希望我的用户注意到外观上的太大差异.我考虑过由锚点(即标签)包裹的图像,但我不想每次更改按钮上的文本时都必须启动图像编辑器.
I'm using ASP.NET, some of my buttons just do redirects. I'd rather they were ordinary links, but I don't want my users to notice much difference in the appearance. I considered images wrapped by anchors, i.e. tags, but I don't want to have to fire up an image editor every time I change the text on a button.
答
应用这个类
.button {
font: bold 11px Arial;
text-decoration: none;
background-color: #EEEEEE;
color: #333333;
padding: 2px 6px 2px 6px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;
}
<a href="#" class="button">Example</a>