html - 图片库(带有顶部两条水平线的图片/视频缩略图)

标签 html css twitter-bootstrap

我的设计如下: enter image description here

到目前为止,我已经完成了 gallery,但现在仍然坚持如何使用 css/html 添加前两行。请建议我如何在顶部添加这些行。

我的 html/css:

.gallery-images img{
	width: 100%;
	min-height: 250px;	
}

.gallery-images{
	padding: 8px;
	border: 0;
	border-radius: 0;
	-webkit-box-shadow: 0 0 10px #ccc;
	box-shadow: 0 0 10px #ccc;
	margin: 0;
}   

.gallery-content{
	margin: 15px 0; 
}
.gallery-content p{
	font-size: 16px;
	font-weight: bold;
	margin: 0; 
}

.gallery-content span{
	color: gray;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>


<section class="inner-bemployee-wrap clearfix">
<div class="col-md-4 col-sm-6 col-xs-12">
                   <div class="thumbnail gallery-images">
                     <img class="img-responsive" src="images/corporate-news.png" />
                     
                   </div>
                   <div class="gallery-content">
                     <p>Album Name</p>
                     <span>15 Photos</span>
                   </div>
                 </div>

               </section>

我用过这个soudo css:

.gallery-images:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 1px;
    top: -8px;
    border-top: 3px solid #D09A77;
}

在顶部显示线条,但现在问题出在移动/表格中,这些线条不是 100% 根据图像拟合的。如何在不同设备上展开/拉伸(stretch)时根据图像限制线条。

最佳答案

Waqas,我认为这可以通过在 <div class="thumbnail gallery-images"> 正上方再添加两个 div 来完成。 .

试试下面的代码。

<div class="first-line"></div>
              <div class="second-line"></div>



.first-line{
 height: 2px;
width: 80%;
border-top: 1px solid #ccc;
padding-bottom: 4px;
margin: 0 auto;}

.second-line{
 height: 2px;
width: 90%;
border-top: 1px solid #ccc;
padding-bottom: 4px;
margin: 0 auto;}

希望对您有所帮助。

关于html - 图片库(带有顶部两条水平线的图片/视频缩略图),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36786833/

相关文章:

html - 如何访问多行中的每四个元素?

html - Twitter Bootstrap 不允许高度 :100% on small screens, 尝试了其他问题中描述的所有解决方案

html - bootstrap css 搜索框不适合导航栏

c# - HTML anchor 替换为 RegEx

html - 为什么图像在小手机屏幕上没有按计划对齐?

javascript - 消除渲染阻塞 JavaScript 和 CSS

html - 具有不同高度列的 Bootstrap 行

javascript - Div 调整大小事件不起作用

javascript - 如何重画 Canvas 圆而不残留?

javascript - FadeOut 伪元素