我遇到了引导弹出框的问题,我正在尝试围绕它设计样式。问题是子内容如果嵌套在跨度内,则不会填充父宽度。Bootstrap 样式通过使用相对位置来跨越。
我唯一的解决方法是在 .popover 类上设置静态宽度。有什么方法可以解决这个问题吗?我假设这个问题与 sup 有关,display:inline
但如果我改变它 obv,<sup>[1]</sup>
就会断线。
html:
<div class='parent'><p>I need the text to look normal <sup class="reference">[1]</sup> every where</p></div>
js:
$('.reference').html($('.reference').html() + "<div class='test'>" +
"<h3>Title</h3>" +
"THis is my random text, that I need to be almost, about this length, maybe a little more... well yea this is enough.<em>Thanks.</em> 6. <a href=\"http://www.google.com\" target=\"_blank\">[pdf]</a>" +
" </div>");
CSS:
sup {
position: relative;
top: -0.5em;
}
.parent {
width: 600px;
height: 200px;
background-color: yellow;
}
.test {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
max-width: 400px;
padding: 1px;
text-align: left;
background-color: #ffffff;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
border-radius: 6px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
white-space: normal;
opacity: 1;
display: block;
top: 90px;
}