20分!width100%后加上margin和padding超出父元素
在图片上显示文字的span的属性如下position:absolute;left:0px;bottom:0px;background-color:rgba(0,0,0,0...
在图片上显示文字的span的属性如下
position: absolute;
left: 0px;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.74);
color: #FFF;
font-size: 15px;
padding: 6px;
margin-bottom: 6px;
margin-left: 6px;
margin-right: 6px;
width: 100%;
HTML结构如下
<div class="g-item">
<img src="images/gallery/g1.jpg" alt="">
<span class="title">测试啊</span>
<a data-rel="lightbox" class="overlay" href="images/gallery/g1.jpg">
<span class="go">+</span>
</a>
</div>
其实我就是想把文字放在白框以内,直接父元素的CSS是
.g-item {
margin-bottom: 30px;
padding: 6px;
position: relative;
background-color: white;
overflow: hidden;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
求怎么把右边超出去的缩回去.. 展开
position: absolute;
left: 0px;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.74);
color: #FFF;
font-size: 15px;
padding: 6px;
margin-bottom: 6px;
margin-left: 6px;
margin-right: 6px;
width: 100%;
HTML结构如下
<div class="g-item">
<img src="images/gallery/g1.jpg" alt="">
<span class="title">测试啊</span>
<a data-rel="lightbox" class="overlay" href="images/gallery/g1.jpg">
<span class="go">+</span>
</a>
</div>
其实我就是想把文字放在白框以内,直接父元素的CSS是
.g-item {
margin-bottom: 30px;
padding: 6px;
position: relative;
background-color: white;
overflow: hidden;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
求怎么把右边超出去的缩回去.. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询