我有一个按钮。当用户按下它时,我希望结果与用户按下特定链接时相同。
换句话说,我想将链接表示为按钮。
从中我可以看到使用Jquery的可能性: 如何通过按钮的onclick事件调用href?
在ReactJS中执行此操作的“正确”方法是什么?
我不知道如何描述我的问题,但看看我的输出你就会明白。我用谷歌搜索了我的问题,但找不到解决方案。

.btn1 {
font-family: 'Times New Roman', Times, serif;
margin-right: 0px;
width: 100px;
height: 30px;
font-size: 17px;
font-weight: 200;
background-color: #f7e7e7;
color: rgb(49, 126, 126);
border-radius: 5px;
border: 1px solid rgb(186, 230, 173);
box-shadow: 3px 3px rgb(98, 151, 98);
}Run Code Online (Sandbox Code Playgroud)
<div>
<a href="#">
<button class="btn1">Home</button>
</a>
<a href="product.html">
<button class="btn2">Products</button>
</a>
<a href="#">
<button class="btn3">Buy Now</button>
</a>
<a href="findus.html">
<button class="btn4">Find us</button>
</a>
</div>Run Code Online (Sandbox Code Playgroud)
每个按钮在 CSS 中都有相同的代码。你能告诉我,我做错了什么吗?谢谢你。
我想做那样的事情:

现在,我正在使用保证金,但我确信有一些"干净"的方法可以做到这一点......:http: //jsfiddle.net/vXMMA/445/
<ul class="media-grid">
<li>
<a href="#">
<img class="thumbnail" src="http://placehold.it/140x90" alt=""/>
</a>
<a href="#" class="btn" style="margin-left:-23px;margin-top:67px;">+</a>
</li>
<li>
<a href="#">
<img class="thumbnail" src="http://placehold.it/140x90" alt=""/>
</a>
<a href="#" class="btn" style="margin-left:-23px;margin-top:67px;">+</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud) 我想嵌套一个按钮,该按钮执行<a>标记之间的 Ajax 操作。

整个容器应该作为一个单独网页的链接,而“收藏夹”按钮将执行一个不相关的 Ajax 操作。不幸的是,这是无法完成的,因为<button>不能嵌套在<a>标签中。
是否有一个简单的解决方法来实现这种效果?
当前代码:
<a class="button7" onmouseover="displayFavorite('000')" onmouseout="hideFavorite('000')" href='http://www.example.com">
Math 141
<button id='000' class="button8" onclick="favorite('000')">Favorite</button>
<ul>
<li><strong>Description</strong> Calculus 1 and Calulus 2</li>
<li><strong>Instructor</strong> Boon Ong</li>
<li><strong>Documents</strong> 17</li>
</ul>
</a>
Run Code Online (Sandbox Code Playgroud)
编辑:请注意,AJAX 只是附加信息,与问题无关。
我试图添加链接到我的按钮我当前的HTML代码如下
得到支持
<td>
<button style="background: url('images/button2.png') no-repeat; background-size:155px; left: 200px; width: 155px; height: 50px; border: 0;">Shop Bike</button>
</td>
<td>
<button style="background: url('images/button2.png') no-repeat; background-size:155px; left: 200px; width: 155px; height: 50px; border: 200px;">Button Three</button>
</td>
Run Code Online (Sandbox Code Playgroud)
以及如何为每个按钮添加其他页面的链接,例如..如果我点击:获取支持按钮,它会将我重定向到我已经创建的支持页面
我遇到了字体很棒的图标问题.当你点击小加号时它很好但是如果你单击按钮的其余部分它将不会带你到链接.
<div class="jumbotron">
<p>
<button type="button" class="btn btn-default pull-right">
<a href="google.com"> <i class="fa fa-plus" title="Edit"></i> </a></button>
</p>
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/py7vA/217/
我该如何解决这个问题?
我有一个HTML链接
<a href='#'><button>+</button> Show advanced options</a>
Run Code Online (Sandbox Code Playgroud)
单击按钮或链接时显示隐藏的选项.问题是按钮和文本之间有一个下划线(只是"显示"之前的一个字符.)有没有办法删除它?
我正在使用magnific-popup来显示一个通过ajax获取内容的表单.这段代码工作正常:
<a href="/entry-form" class="ajax-popup-link">
<button class="green">Enter Now</button></a>
...
<script>
$('.ajax-popup-link').magnificPopup({
type: 'ajax'
});
</script>
Run Code Online (Sandbox Code Playgroud)
但根据HTML5规则,<button>标记不能位于<a>标记中.
所以我将html代码更改为:
<button class="green" href="/entry-form" class="ajax-popup-link">Enter Now</button>
Run Code Online (Sandbox Code Playgroud)
但是magnific-popup代码无法识别<button>元素上的href属性.
我该怎么做?
编码html和css相当新,并希望确保我保持代码清洁并正确关闭标签.我正在使用html模板并尝试从我的按钮正确创建链接.
我将它们包装在Brackets中的方式是在页面上正常工作并且链接正常工作,但是Brackets显示了一些红色标记,这意味着我没有正确包装.
有人可以告诉我我做错了什么,因为我想跟随好的代码形式前进.
非常感谢.
以下按钮的当前代码:
<a href="contact_us.html"<button class="button -blue -bordered"><span class="button--inner">Contact Us</span></button></a>Run Code Online (Sandbox Code Playgroud)