我正在尝试使用 twitter bootstrap 来创建类似 Facebook 的工具提示布局。
如果有人能让我知道如何使用 twitter bootstrap 来创建此布局,我将不胜感激,我不需要它作为工具提示,我需要它在常规 div 中。
我附上了代表我正在寻找的图片。
最佳答案
这是我使用 Twitter Bootstrap 框架对该框的看法。不得不修改一些跨度宽度以符合您的图像尺寸,但我使用了一个 id 来定位它们,这样它们就不会在您的页面设计中打扰其他 span*
类。
我把它放在 jsFiddle 上,因为它有相当多的代码,所以检查一下:demo在这里,编辑 here .
CSS:
body {
margin:50px;
}
#box {
border: 1px solid #92959C;
width:290px;
padding-top: 10px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
-webkit-box-shadow: 0px 0px 4px 0px #ccc;
-moz-box-shadow: 0px 0px 4px 0px #ccc;
box-shadow: 0px 0px 4px 0px #ccc;
}
#box .row {
margin-left: -10px;
}
#box [class*="span"] {
margin-left: 10px;
}
#box .span0 {
width:32px;
margin-left:1px;
}
#box li.span0:first-child {
margin-left: 0;
}
#box .span1 {
width: 96px;
}
#box .span2 {
width:165px;
margin-left:10px;
}
#box .span2 p, .span2 a {
font-size:12px;
margin:0;
}
#box .span2 h4 {
font-size:13px;
line-height:10px;
}
#box .span1 img {
width:96px;
height:96px;
}
#box .img-list {
margin:0;
padding:0;
list-style:none;
}
#box-footer {
margin-top:10px;
width:290px;
border-top:1px solid #aaa;
}
.gray {
background-color:#F2F2F2;
padding:10px 10px 20px;
min-height:20px;
}
HTML:
<div class="container">
<div class="row">
<div id="box" class="span4">
<div class="span1">
<img alt="" src="http://placehold.it/96x96">
</div>
<div class="span2">
<h4>Omer</h4>
<p class="muted">AI Lead at New brand analytics</p>
<a href="#">64 mutual friends</a>
<ul class="img-list">
<li class="span0">
<img alt="" src="http://placehold.it/32x32">
</li>
<li class="span0">
<img alt="" src="http://placehold.it/32x32">
</li>
<li class="span0">
<img alt="" src="http://placehold.it/32x32">
</li>
<li class="span0">
<img alt="" src="http://placehold.it/32x32">
</li>
<li class="span0">
<img alt="" src="http://placehold.it/32x32">
</li>
</ul>
</div>
<div class="row">
<div id="box-footer" class="span4">
<div class="gray">
<a href="#" class="btn pull-right">Friends</a>
</div>
</div>
</div>
</div>
</div>
</div>
关于html - 如何使用 Twitter Bootstrap 创建类似 Facebook 的工具提示布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9998462/