如何使 HTML 锚标记(或链接)看起来像一个按钮?

新手上路,请多包涵

我有这个按钮图片:

在此处输入图像描述

我想知道是否有可能做一个简单的

<a href="">some words</a>

和样式链接显示为该按钮?

如果可能的话,我该怎么做?

原文由 GeekedOut 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 395
2 个回答

使用 CSS:

 .button {
    display: block;
    width: 115px;
    height: 25px;
    background: #4E9CAF;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    line-height: 25px;
}
 <a class="button">Add Problem</a>

http://jsfiddle.net/GCwQu/

原文由 Declan Cook 发布,翻译遵循 CC BY-SA 4.0 许可协议

检查 Bootstrap 的文档。 A class .btn exists and works with the a tag, but you need to add a specific .btn-* class with the .btn class.

例如: <a class="btn btn-info"></a>

原文由 Gildas Ross 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题