【问题标题】:Setting tool tip text horizontally水平设置工具提示文本
【发布时间】:2021-02-08 19:20:33
【问题描述】:

基本上,我希望我的工具提示文本水平显示,背景颜色为黄色。仅供参考,我使用引导工具提示。

这是工具提示文本的当前代码:

<c:choose>
   <c:when test="${fn:length(product.description) gt 56}">
     <div class="description-wrapper" data-toggle="tooltip" dataplacement="bottom"title="${product.description}">${product.description}</div>
   </c:when>
   <c:otherwise>
     <div class="description-wrapper">${product.description}</div>
   </c:otherwise>
</c:choose>

这里是 jQuery 代码:

    <script>
    $(document).ready(function(){
        $('[data-toggle="tooltip"]').tooltip();
    });
    </script>

目前对于上面的代码,工具提示的文字是垂直显示的,如图:

所以我需要完成两件事:我需要使工具提示文本框和文本以宽度大于其高度的水平方式显示,如果有意义的话,基本上就像一个矩形。其次,我希望背景颜色为黄色。

【问题讨论】:

    标签: java html css twitter-bootstrap-3


    【解决方案1】:
    .tooltip-inner {
      width: 300px; /* width of tooltip */
      background: #999; /* you can add custom color here */
    }
    
    .tooltip.top .tooltip-arrow {
      border-top-color: #999; /* you can add custom color here */
    }
    

    【讨论】:

      猜你喜欢
      • 2021-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多