首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >引导4工具提示文本格式

引导4工具提示文本格式
EN

Stack Overflow用户
提问于 2020-03-25 11:14:04
回答 2查看 492关注 0票数 1

我一直在努力使我的站点上的工具提示看起来很漂亮,最近我在Godaddy.com上遇到了工具提示,我希望能够复制在以下内容上形成的文本:

目前,我自己的工具提示如下:

这是我当前的代码,当在图像上盘旋时,工具提示出现是非常重要的(我知道这看起来很混乱,但请忽略它):

代码语言:javascript
复制
<img src="image URL here" width="20" data-toggle="tooltip" data-placement="top" title="A short description of your project/solution (max 250 characters), will only be displayed on the home screen, not in your post! If you do not wish to use this leave 'None'">

我主要要做的是能够在工具提示中创建新的行。

任何建议都是见仁见智的!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-03-25 17:43:22

通过添加固定

代码语言:javascript
复制
data-html="true"

这允许我在标题文本中使用<br/>

最后的代码片段:

代码语言:javascript
复制
<img src="image URL here" width="20" data-html="true" data-toggle="tooltip" data-placement="top" title="A short description of your project/solution (max 250 characters), will only be displayed on the home screen, not in your post! <br/> If you do not wish to use this leave 'None'">
票数 0
EN

Stack Overflow用户

发布于 2020-03-25 11:21:17

你可以这样做:

您可以通过在内容之间添加<br />来添加新行,这对您来说是可行的。

代码语言:javascript
复制
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 220px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  text-align: justify;
  /* This is what you need */
  /* Position the tooltip */
  position: absolute;
  z-index: 1;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}
代码语言:javascript
复制
   <div class="tooltip">Hover me
  <span class="tooltiptext">A short description of your project/solution (max 250 characters), will only be displayed on the home screen. <br /> <br /> Second para not in your post! If you do not wish to use this leave 'None</span>
</div>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60847671

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档