这对于工具提示有效吗?由于某种原因,我认为在标题字段中添加 div 是无效的。
<div class="graph_item tooltip" title="
<div id='tooltip_inner_container'>
<div id='title'>Ready Set Cook!</div>
<strong>250 HEALTHY POINTS</strong>
The Goal of Ready, Set, Cook! is to cook and log at least 1 recipe per week for 8 weeks. If you complete this challenge, You will
become eligible for prizes.<br /><br />
Registration:
May 7 - May 14<br />
Duration: May 15 - June 6
</div>
" style="width:100%; height:58px; left:0%; top:0%; background-color:#0073ad; background-image:url(images/a.jpg);">
最佳答案
也不是有效的 XML,您不应该将节点放入属性中。
我建议使用像这样的html:
<div class="graph_item has-tooltip" style="width:100%; height:58px; left:0%; top:0%; background-color:#0073ad; background-image:url(images/a.jpg);">
<div class="tooltip" id='tooltip_inner_container'>
<div id='title'>Ready Set Cook!</div>
<strong>250 HEALTHY POINTS</strong>
The Goal of Ready, Set, Cook! is to cook and log at least 1 recipe per week for 8 weeks. If you complete this challenge, You will
become eligible for prizes.<br /><br />
Registration:
May 7 - May 14<br />
Duration: May 15 - June 6
</div>
</div>
</div>
作为CSS: .has-tooltip .tooltip { 显示:无; } .has-tooltip .tooltip:hover{ 显示: block ; }
关于html - 在 title =""字段中放置 div 标签是否有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17172519/