• When posting, please be aware that artistic nudity is still nudity and not allowed under RpNation rules. Please edit your pictures accordingly!

    Remember to credit artists when using work not your own.

Help Transparent Overlay

Mx.Trinity

Pro Stranger
Hey! So I'd like to make a transparent gif overlay on a background without turning EVERYTHING transparent. I'm using the "opacity: xy%;" and it's turning everything transparent. How do I isolate the transparency of that particular gif to just the background and nothing else?
 
It'd be best if I could see the code in question, since I can't visualize what you want done.

Below's some general advice when dealing with opacity.

Unfortunately, all child elements will automatically follow the parent element's opacity. You're better off manually doing it on a graphic editing software if my understanding of your question is correct.
You could also use positioning, but that tends to be more trouble than it's worth.

If you opt to edit the gif's transparency yourself via editing software, you can just use
Code:
background: url(if image, if a normal color just state your hex), url(gif);
and it should layer it for you.
 
well just imagine a background with text boxes ontop of it. I want to put a transparent gif over the background without affecting the front elements (text boxes, other images, etc.) I think it has something to do with CSS
 
well just imagine a background with text boxes ontop of it. I want to put a transparent gif over the background without affecting the front elements (text boxes, other images, etc.) I think it has something to do with CSS
There actually isn't a way to do exactly what you want via the coding here on RPNation (that I know of) as there isn't really a true way of even doing it with just CSS, you have to create a pseudo element. You can read about that here.

You would have to actually make the image you want transparent.
 
Ah so as fluticasone fluticasone said. Probably easier than coding for margins.
Basically. You can always try creating a completely separate DIV with the bg transparent, but you would have to position it to overlay exactly. Not sure it would work that well since I've never bothered with the attempt myself, I've just heard of the method.
 
Here's an example of what Fable Fable is talking about.

.
CONTENTCONTENTCONTENTCONTENT


Code:
[div=
  width: 200px;
  height: 200px;
  position: relative;
  background: url(https://i.imgur.com/T9BW6tB.jpg);
][div=
  background: url(https://media.giphy.com/media/xTiTnxpQ3ghPiB2Hp6/giphy.gif);
  opacity: 0.5;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  position: absolute;
].[/div]CONTENTCONTENTCONTENTCONTENT[/div]
 

Users who are viewing this thread

Back
Top