我有被称为像这样我的网页链接:我可以做一个按钮的捷径吗?
<a href="/xxx/" >
<button >xxx</button>
</a>
我有几个这样的,我想很容易让用户点击,而不必去按钮,用户并单击。我可以给用户一个快捷方式,比如ALT M或者类似于按钮的东西吗?如果用户点击输入,我也可以使按钮成为默认按钮吗?
我有被称为像这样我的网页链接:我可以做一个按钮的捷径吗?
<a href="/xxx/" >
<button >xxx</button>
</a>
我有几个这样的,我想很容易让用户点击,而不必去按钮,用户并单击。我可以给用户一个快捷方式,比如ALT M或者类似于按钮的东西吗?如果用户点击输入,我也可以使按钮成为默认按钮吗?
您应该使用accesskey财产
<a href="/xxx/" >
<button accesskey="M" >xxx</button>
</a>
我会推荐的造型一个div看起来像一个按钮,因为他们以stackoverflow.com上的标签为例
通过stackoverflow.com使用CSS(需要一些工作!)
.post-taglist {
clear: both;
margin-bottom: 10px;
}
.edit-tags-wrapper > a.post-tag {
margin-right: 6px;
}
.post-tag, .post-text .post-tag, #wmd-preview a.post-tag {
background-color: #E0EAF1;
border-bottom: 1px solid #3E6D8E;
border-right: 1px solid #7F9FB6;
color: #3E6D8E;
font-size: 90%;
line-height: 2.4;
margin: 2px 2px 2px 0;
padding: 3px 4px;
text-decoration: none;
white-space: nowrap;
}
post-tag:hover, .post-text .post-tag:hover, #wmd-preview a.post-tag:hover {
background-color: #3E6D8E;
border-bottom: 1px solid #37607D;
border-right: 1px solid #37607D;
color: #E0EAF1;
text-decoration: none;
}
或者你可以用你的按钮表单元素像
<form method="post" action="nextPage.html" >
<button>Press me</button>
</form>
我希望这有助于。
根据浏览器和平台,用户按下1加适当的键(alt/meta/ctrl) – Eineki 2011-06-10 11:44:04
@Eineki:这就是所谓的[修饰键](http://en.wikipedia.org/wiki/Modifier_key)。 – Marcel 2011-06-10 11:46:16