2016-04-25 82 views
0

I am using wordpress for this project. How can I handle the <a> tag which is getting displayed inside a button?
Here is how I am using it如何处理<a href> inside a button in wordpress

<button class="red-btn btn-effect reply" type="button"> 
     <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> 
    </button> 

and its output is shown as

<button class="red-btn btn-effect reply"> 
     <a rel="nofollow" class="comment-reply-link" href="http://localhost/dynamoLogic/security-vulnerabilities-in-php/?replytocom=3#respond" onclick="return addComment.moveForm(&quot;comment-3&quot;, &quot;3&quot;, &quot;respond&quot;, &quot;18&quot;)" aria-label="Reply to umair">Reply</a>  </button> 

Html5 does not support <a> tags inside a button. How to handle this?

+0

Is there any reason for using a button? ''适当的造型应该是足够的。取''元素上的类属性值并添加到'',你应该没问题,然后移除按钮。 –

回答

0

That is because a button is not a link.

Remove the button and your output should actually be something like this instead:

<a rel="nofollow" class="red-btn btn-effect reply comment-reply-link" href="http://localhost 
/dynamoLogic/security-vulnerabilities-in-php/?replytocom=3#respond" 
onclick="return addComment.moveForm(&quot;comment-3&quot;, &quot;3&quot;, 
&quot;respond&quot;, &quot;18&quot;)" aria-label="Reply to 
umair">Reply</a> 

Add in the neccessary classes for the link, you may need to make adjustments to the CSS for the a element.