【发布时间】:2017-08-19 20:36:32
【问题描述】:
我正在尝试将this sort of overlay effect 应用于悬停时的背景图像。但是我只希望这种转换应用于背景图像,而不是 div 中的文本或其他内容。
这是我目前没有任何悬停效果的代码 - 上面 w3schools 链接中的方法似乎不合适:
.background-image {
background: url('http://placehold.it/350x200') no-repeat center;
}
.about-text {
color: #ffffff;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="col-md-6 text-center background-image overlay">
<div class="about-text">
<p>Some descriptive text here. Blah blah blah.</p>
<p class="text-center"><a class="btn btn-primary" href=""> Button </a></p>
</div>
</div>
【问题讨论】:
标签: html css hover css-transforms