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
<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( "comment-3", "3", "respond", "18" )" aria-label="Reply to umair">Reply</a> </button>
Html5 does not support <a>
tags inside a button. How to handle this?
答案 0 :(得分:0)
这是因为按钮不是链接。
删除按钮,输出实际应该是这样的:
<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( "comment-3", "3",
"respond", "18" )" aria-label="Reply to
umair">Reply</a>
添加链接的必要类,您可能需要调整a元素的CSS。