2016-04-25 47 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.

関連する問題