这是一个基本问题,我觉得很尴尬。每当我回显html标签,而不是渲染标签时,它只会显示在echo输出中。我试过单引号和双引号,但仍然没有运气。我在这做错了什么?感谢
<a style="margin-left: 12px;" href="javascript:void(0)" class="tooltip" title="<?php echo "Please select your boxes from the list. You can select a max of 20 boxes per submission.<br />You can select multiple boxes by holding the left ctrl on your keyboard and making your selection"; ?>">Help</a>
ff渲染输出:
title="Please select your boxes from the list. You can select a max of 20 boxes per submission.<br />You can select multiple boxes by holding the left ctrl on your keyboard and making your selection"
答案 0 :(得分:1)
HTML代码不能放在标题标记内,因为浏览器不会将标题呈现为纯文本字符串以外的任何内容。
答案 1 :(得分:1)
使用此代替您的<a/>
代码:
<a style="margin-left: 12px;" href="javascript:void(0)" class="tooltip" title="<?php echo 'Please select your boxes from the list. You can select a max of 20 boxes per submission.<br />You can select multiple boxes by holding the left ctrl on your keyboard and making your selection';?>">Help</a>
或者:
<?php
$titleText = 'Please select your boxes from the list. You can select a max of 20 boxes per submission.<br />You can select multiple boxes by holding the left ctrl on your keyboard and making your selection';
?>
<a style="margin-left: 12px;" href="javascript:void(0)" class="tooltip" title="<?=$titleText;?>">Help</a>