文本无法在HTML中正确显示

时间:2015-04-23 20:54:39

标签: javascript html

有人可以掠夺我的HTML并告诉我它为什么不能正常工作以及我能做些什么来解决它。问题是跨度内的文本未正确显示。我不明白的是>< 12(一个数字)正确显示。

这是小提琴 https://jsfiddle.net/rwfg0wtL/

这里是完整的代码

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <table border=0 style='table-layout:fixed;display:block; width:100%; cellPadding=3;' class='previewText'>

        <thead>
            <colgroup>
                <col align='left' width='20px'>
                <col align='left'>

            </colgroup>
        <tbody>
            <tr id='complaintrow' name='complaintrow' selected=true>
                <td style="" width:20px"" valign="" top""><img src='images/checkon.gif' height=16 width=16 style='cursor:hand' language=vbscript onclick='select'></td>
                <td align=left>
                    <span language=vbscript ondrop='StopBubble' onpaste='CheckPaste' class=labelOnPreviewcc style="" width:100%; word-break:break-all;"" id=txtValue>

                         ><test <!--'This does not work-->
                        <br/>
                         ><12 <!--this works--> 
                        <br/>
                        ><1test <!--this works-->
                    </span>
                </td>
            </tr>
        </tbody>
    </table>

</body>
</html>

1 个答案:

答案 0 :(得分:5)

XML中或HTML中的原始文本中不允许使用

<>&。要将它们放入文档中,您需要输入&lt;(小于),&gt;(大于)和&amp;(&符号)。

相关问题