简体   繁体   English

"如何制作没有背景图片的透明背景?"

[英]How to make a transparent background without background image?

I would like a div to have a transparent background.我希望一个div有一个透明的背景。
I tried to do this using background-color and opacity , but the problem is that the border and the text inside become also transparent.我尝试使用background-coloropacity来做到这一点,但问题是边框和里面的文本也变得透明。 Example here.这里的例子。

Is this possible to achieve this without using transparent PNG background image ?这是否可以在不使用透明 PNG 背景图像的情况下实现?

I would like a div to have a transparent background.我希望div具有透明的背景。
I tried to do this using background-color and opacity , but the problem is that the border and the text inside become also transparent.我尝试使用background-coloropacity做到这一点,但是问题是边框和里面的文本也变得透明。 Example here.这里的例子。

Is this possible to achieve this without using transparent PNG background image ?是否可以在不使用透明PNG背景图像的情况下实现这一目标?

I would like a div to have a transparent background.我希望div具有透明的背景。
I tried to do this using background-color and opacity , but the problem is that the border and the text inside become also transparent.我尝试使用background-coloropacity做到这一点,但是问题是边框和里面的文本也变得透明。 Example here.这里的例子。

Is this possible to achieve this without using transparent PNG background image ?是否可以在不使用透明PNG背景图像的情况下实现这一目标?

I would like a div to have a transparent background.我希望div具有透明的背景。
I tried to do this using background-color and opacity , but the problem is that the border and the text inside become also transparent.我尝试使用background-coloropacity做到这一点,但是问题是边框和里面的文本也变得透明。 Example here.这里的例子。

Is this possible to achieve this without using transparent PNG background image ?是否可以在不使用透明PNG背景图像的情况下实现这一目标?

I would like a div to have a transparent background.我希望div具有透明的背景。
I tried to do this using background-color and opacity , but the problem is that the border and the text inside become also transparent.我尝试使用background-coloropacity做到这一点,但是问题是边框和里面的文本也变得透明。 Example here.这里的例子。

Is this possible to achieve this without using transparent PNG background image ?是否可以在不使用透明PNG背景图像的情况下实现这一目标?

这段代码是一个非常简单的在 html 中具有清晰透明背景的 CSS 方法。

background: rgba(0, 0, 0, 0.6)!important;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM