我遇到了一个引导弹出窗口的问题,我正试图绕过它。问题是子内容如果嵌套在跨度内,则不会填充父级宽度。 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;
}
答案 0 :(得分:1)