【发布时间】:2022-01-27 00:33:01
【问题描述】:
这是在alt 属性中为img 元素的替代文本使用转义字符的正确方法吗?
我有以下代码:
<h3>Option 1</h3>
<img src="image.jpg"
alt='Version of "Whistler\'s Mother" in cubist style'>
<br><br>
<h3>Option 2</h3>
<img src="image.jpg"
alt="Version of \"Whistler's Mother\" in cubist style">
以上两个选项中的任何一个都不能作为替代文本正常工作。我想显示的替代文本是:
Version of "Whistler's Mother" in cubist style
【问题讨论】:
-
这能回答你的问题吗? How can I escape a single quote?
标签: html image text alt html-escape-characters