gpt4 book ai didi

html - 如何在不影响文本的情况下设置背景不透明度

转载 作者:搜寻专家 更新时间:2023-10-31 08:04:33 25 4
gpt4 key购买 nike

<分区>

我基本上是在尝试创建这个:enter image description here

添加了一个带有背景图片的父容器,然后是一个需要透明的子容器。

这是我的 HTML:

<div class="scent-brand-contact">
<div class="scent-brand-container">
<section id="black-studio-tinymce-8" class="widget-1 widget-first widget-odd widget widget_black_studio_tinymce">
<div class="textwidget">
<p>All our fragrances are developed in compliance with the International Fragrance Association ensuring strict adherence to safety purity and manufacturing standards.</p>
<p>LEARN MORE ABOUT HOW SCENT BRANDING CAN BENEFIT YOUR BUSINESS</p>
</div>
</section>
<section id="text-4" class="widget-2 widget-last widget-even widget widget_text">
<div class="textwidget">
<button type="button">contact us today</button>
</div>
</section>
</div>
</div>

还有 CSS:

.scent-brand-contact{
position:relative;
background-image: url(images/lemon.jpg);
background-position: center center;
background-attachment: fixed;
background-size: cover;
min-height:380px;
}
.scent-brand-container {
background-color: #fff9c0;
padding: 10px;
opacity: 0.7;
padding-top: 5%;
margin: auto;
position: absolute;
top: 12%;
width: 100%;
min-height: 285px;
}

目前,按钮和文本也变得不透明了。如何在不影响文本和按钮的情况下拥有透明背景?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com