2

这对工具提示有效吗?出于某种原因,我认为在标题字段中添加 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);">
4

2 回答 2

1

也不是有效的 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{ 显示:块;}

于 2013-06-18T15:12:57.523 回答
1

是的,您的 HTML 是有效的(div当然,如果您关闭 )。

但是,此title属性的内容不是(也不能是)HTML。是文字。

在此处输入图像描述

于 2013-06-18T15:20:18.343 回答