I'm making a portfolio and I'd like to know how to set a div property that makes the div's TEXT transparent and background and such opaque.
Asked
Active
Viewed 1.5k times
1
-
2Use Canvas for this and create a Picture. Or better SVG with a text path – CoderPi Jan 05 '16 at 21:59
-
1`color: rgba(0,0,0,0);` would be one way. – abluejelly Jan 05 '16 at 22:00
-
1depends on your specification. CSS has a propperty called "opacity" which you can set in percentages. – Dorvalla Jan 05 '16 at 22:01
-
Let this be a lesson to you: ask a vague question, get a lot of eye-rolling answers. With the example, this is actually a significantly harder question than the one we were answering. Off the top of my head, the SVG method might actually be easiest. – abluejelly Jan 05 '16 at 22:12
2 Answers
3
Use rgba
and set the opacity to 0 (the last value).
color:rgba(0, 0, 0, 0);
See here
UPDATE
Now that you have clarified your question... SVG would be your best bet. See fill-opacity

zgood
- 12,181
- 2
- 25
- 26
-
-
@CodeiSir `color` is the css property for text color, `background-color` is for background and `opacity` is for everything – zgood Jan 05 '16 at 22:07
-
@CodeiSir he says with all caps that the TEXT needs to be transparent and the background opaque. Not really sure what you're on about. This does exactly that. – abluejelly Jan 05 '16 at 22:09
0
Try the red,green,blue,alpha
value for the color
div{
width: 50%;
height: 50%;
background: green;
}
p{
font-size: 30px;
font-weight: bolder;
color: rgba(0,0,0,.1);
}
<div>
<p> your text </p>
</div>

Esteban Rincon
- 2,040
- 3
- 27
- 44