【问题标题】:How can I force paragraph to render within a div and expand the divs height?如何强制段落在 div 内呈现并扩展 div 高度?
【发布时间】:2013-11-22 22:41:55
【问题描述】:

我正在使用 AngularUI-bootstrap 提供带有一些自定义 CSS 的工具提示。我的 .tooltip-inner 类的最大宽度为 300px。 .tooltip 类是它的容器,它是绝对定位的。 HTML/CSS 看起来像这样,混淆了一些抱歉...

<div class="tooltip-inner ng-binding" bind-html-unsafe="content">
  <p>Lorem ipsum made using yada yada yada. Here are a few helpful definitions for ones requiring a little more explanation.</p>
  <ul>
       <li>xxxxxxxxxxxxxxxxxxxxxxxx.</li>
       <li>yyyyyyyyyyyyyyyyyyyyyyyyyitution.</li>
       <li>zzzzzzzzzzzzzzzzzzzzzzzzzzz.</li>
  </ul>
  <a href="#" data-value="close">Close</a>
</div>

.tooltip-inner {
     padding: 7px;
     min-width: 130px;
     color: #666;
     -webkit-border-top-left-radius: 0;
     -moz-border-radius-topleft: 0;
     border-top-left-radius: 0;
    -webkit-border-bottom-left-radius: 0;
    -moz-border-radius-bottomleft: 0;
    border-bottom-left-radius: 0;
    border: 1px solid transparent;
    border-right-color: #b8b8b8;
    border-top-color: #a9d0e5;
    border-bottom-color: #b8b8b8;
    background-color: #f3fafd;
    -webkit-box-shadow: .4em .4em 1.2em -0.3em rgba(89,89,89,0.27);
    -moz-box-shadow: .4em .4em 1.2em -0.3em rgba(89,89,89,0.27);
    box-shadow: .4em .4em 1.2em -0.3em rgba(89,89,89,0.27);
    text-shadow: .0555em .0555em .01em rgba(178,178,178,0.7);
}

没有样式设置高度或位置。据我所知,子元素没有会导致这种行为的特定样式。

我怎样才能让 div .tooltip-inner 扩展它的高度并保持它的宽度,它目前保持宽度,但显然这不是我想要的。任何帮助是极大的赞赏。

【问题讨论】:

    标签: html css twitter-bootstrap angular-ui


    【解决方案1】:

    尝试将外部 div,tooltip-inner,样式设置为overflow:auto

    【讨论】:

    • 我试过了,但它只是放入一个水平滚动条,根本不会破坏文本。基本上看起来是一样的,只是文本现在可以滚动了。谢谢你的回答。
    • 我很抱歉这不应该被否决。我只是说我试过了,但它对我不起作用。我试图删除反对票,stackoverflow 不会离开我。请让我知道如何纠正这个问题。道歉。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-29
    • 1970-01-01
    • 1970-01-01
    • 2014-01-13
    • 2015-04-23
    • 2012-05-15
    相关资源
    最近更新 更多