html - 在 title =""字段中放置 div 标签是否有效

标签 html tooltip

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

相关文章:

android - TooltipCompat 导致 BadTokenException

php - 输入时提交

javascript - 使用css在html中的字体大小

javascript - 循环浏览一组表单并在单击按钮时显示相应的表单

javascript - 当我用 jquery 在可编辑的 div 中写入时的实时样式

angular - 用 Angular 2 覆盖羽毛笔编辑器链接

javascript - 在javascript中垂直定位工具提示

html - 第 n 个 child ()还是第一个 child ?如何选择第一个和第二个 child

javascript - 在 dxChart 中自定义工具提示

WPF 工具提示 ControlTemplate 不显示内容