我在将标题放置在图片顶部时遇到问题。图片在一列,有4列。前 3 列似乎工作正常,但是当涉及到最后一列时,它看起来一点也不正确,我觉得它可能与 wordpress css 有关?我试图将css添加到正确定位它的最后一列,但宽度不正确......我很困惑。这可能是一个简单的修复,但我似乎无法弄清楚
这是网站的链接 http://aminkhalil.com
这是我的html代码
[fourcol_one]
<a href="#" class="caption">
<img class="hover" alt="Services" src="http://growinggood.com/wp-content/uploads/2014/02/billboard-slider-images.jpg" />
<span class="caption">Services</span></a>
[/fourcol_one]
[fourcol_one]
<a href="#" class="caption">
<img class="hover" alt="Keep Healthy" src="http://growinggood.com/wp-content/uploads/2014/02/billboard-slider-images.jpg" />
<span class="caption">Keep Healthy</span></a>
[/fourcol_one]
[fourcol_one]
<a href="#" class="caption">
<img class="hover" alt="Meet The Staff" src="http://growinggood.com/wp-content/uploads/2014/02/billboard-slider-images.jpg" />
<span class="caption">Meet The Staff</span></a>
[/fourcol_one]
[fourcol_one_last]
<a href="#" class="caption">
<img class="hover" alt="Portal" src="http://growinggood.com/wp-content/uploads/2014/02/billboard-slider-images.jpg" />
<span class="caption">Portal</span></a>
[/fourcol_one_last]
这是我的CSS
a.caption{
position:relative;
}
a:hover img.hover{
opacity: 0.5;
filter: alpha(opacity=530);
}
span.caption{
color: #fff !important;
position: absolute;
bottom: 0;
left: 2%;
padding: 1.9%;
width: 93%;
background-color: rgba(0,0,0,0.5);
}
.last span.caption{
bottom: 22px;
left: 3px;
}
任何帮助表示赞赏。先感谢您!!