在引号内插入 HTML
我想要在链接的标题属性内添加分页符,但是当我放入分页符时,它在浏览器中显示正确,但在验证时返回 7 个错误。
这是代码。
<a href="images/Bosses/Lord Yarkan Large.jpg" class="hastipz" target="_blank" title="Lord Yarkan, a level 80 Unique from Silkroad Online -- Click for a Larger Image">
<img class="bosspic" src="images/Bosses/Lord Yarkan.jpg" style="float:right; position:relative;" alt="Lord Yarkon; Silkroad Unique"/>
</a>
原因是因为标题属性出现在工具提示中,并且我需要在该工具提示内添加分页符。如何在引号内添加分页符而不返回错误?
I want a page break inside the title attribute of a link, but when I put one in, it appears correct in a browser, but returns 7 errors when I validate it.
This is the code.
<a href="images/Bosses/Lord Yarkan Large.jpg" class="hastipz" target="_blank" title="Lord Yarkan, a level 80 Unique from Silkroad Online -- Click for a Larger Image">
<img class="bosspic" src="images/Bosses/Lord Yarkan.jpg" style="float:right; position:relative;" alt="Lord Yarkon; Silkroad Unique"/>
</a>
The reason is because the title attribute appears in a tooltip, and I need a page break inside that tooltip. How can I add a page break inside the quotes without returning errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现此论坛帖子:
1)虽然是非标准的。适用于 IE/Chrome,不适用于 Firefox。 新规范似乎推荐 (换行)代替。
I found this forum post:
1) is Non-standard though. Works on IE/Chrome, not with Firefox. The new spec appears to recommend (newline) instead.
您需要验证工作吗?
如果没有,如果它按您想要的方式工作,则不必担心错误。
验证不是目标。它是帮助构建更好的网站的工具。这就是目标。 ;-)
如果您必须验证它,您可以尝试使用一些脚本在 dom 准备就绪时为
切换特定关键字/字符集。 虽然这还没有经过测试,我也不确定它不会抛出错误。编辑
根据要求,用一点 jQuery 来切换单词:
示例:http://jsfiddle.net/jasongennaro/qRQaq/1/
注意:
\n
换行符替换的。\n
换行符...可能无需替换任何内容即可工作。Do you need to validate for work?
If not, do not worry about the errors if it works as you want it.
Validation is not the goal. It is a tool to help build better Web sites. which is the goal. ;-)
If you must have it validate, you could try to use some script to switch out a specific keyword / set of characters for a
<br />
at dom ready. Although this is untested and I am not sure it wouldn't throw errors, too.EDIT
As requested, a little jQuery to switch out a word:
Example: http://jsfiddle.net/jasongennaro/qRQaq/1/
Nb:
\n
line break character.\n
line break character on its own... might work without needing to replace anything.