如何模糊文本的背景而不模糊文本

时间:2015-11-26 17:31:13

标签: html css css3 twitter-bootstrap-3 blur

enter image description here

HTML

<div class="jumbotron text-white tteesstt text-center">
    <h2 class="text-white" >ABOUT</h2>
    <h3 class="text-white">We invite you to enjoy a luxurious ground transportation service provided by our team of experts. We have the experience and skills to meet the expectations of every passenger and add value to every ride.</h3>
</div>

CSS

.tteesstt {
    background: url('../img/banner/about-suv.png') no-repeat;
    background-size: cover;
}

2 个答案:

答案 0 :(得分:-1)

一个简单的解决方案是将背景元素添加到h2和h3。您可以将背景颜色设置为某种浅灰色,然后添加不透明度,以模仿模糊效果。

这在渲染方面非常有效,并且可以重现,是您的目标。 CSS示例:

.h2 .h3{
background-color: #ffffff;
opacity:0.6;
}

答案 1 :(得分:-1)

模糊文本的背景,在“.tteesstt”元素中创建一个div,其中包含名为“about-container”的类或任何你想要命名的类,并在里面添加h3标签。添加不透明度到“约 - 容器”容器的背景颜色,如此;

.about-container{ background-color: rgba(0,0,0,0.5);   }
相关问题