This question already has answers here:
How do I give text or an image a transparent background using CSS?
(29 answers)
I do not want to inherit the child opacity from the parent in CSS
(18 answers)
Closed 3 years ago.
I understand that this question may have been answered before, but I am having trouble, only setting the opacity to the background (container), but not the text, but when i set the opacity on the container, then it also sets it on the text.
I have tried researching on google and even on here, but nothing seems to work
html
<div class="container">
<div class="test">
<div class="title">
<h3>"The Rising Dead"</h3>
</div>
</div>
</div>
css
.container{
background-color: rgba(255, 0, 0);
opacity: 0.5;
width: 1350px;
margin-left: 280px;
height: 500px;
}
.title h3{
opacity: 7;
}
Screenshot:
https://imgur.com/rATgSiz
Any help appreciated and thanks in advance
rgba has opacity itself, it's 4th parameter:
rgba(255, 0, 0, 0.5)
Related
This question already has answers here:
What's the difference between CSS classes .foo.bar (without space) and .foo .bar (with space)
(6 answers)
What does the "+" (plus sign) CSS selector mean?
(9 answers)
Closed 3 days ago.
I am learning CSS and I am stuck in a specific task.
I want to have an icon next to some text. When I hover over the icon I want to display some other content which is initially hidden. The html code is:
<div id="dropdown">
dropdown
<img id='icon' src="./icon.png" width="24px" height="24px">
<div id="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
And CSS:
#dropdown {
border:solid red;
}
#dropdown-content {
display: none;
position:absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index:1;
}
#icon:hover #dropdown-content {
display: block;
}
My problem is that when I hover over the icon nothing happens.
Instead when I change the last CSS segment to:
#dropdown:hover #dropdown-content {display:block;}
then everything works fine. I dont understand why this is happening. Thanks in advance.
This question already has answers here:
Text blended over background color
(1 answer)
Dual-Color Text
(2 answers)
black and white text based on background image with css
(2 answers)
Closed 11 months ago.
So, I was practicing in HTML and CSS as usual and yesterday I started working on a PSD template. It seemed easy for me, but in a few seconds, I bunched in the issue that I am talking about right now.
In general, I want to change the exact part of a text based on its background. I've already tried "mix-blend-mode", but unfortunately, the result wasn't satisfying for me.
Here is what I want.
So, as you can see the text before the center is white-colored, but the text after the center has the same color as the background before the center.
Is there any way to do that using CSS or maybe even Javascript.
You could do something like this:
<style>
.container {
display:block;
position:relative;
width:150px;
height:50px;
text-align: center;
}
.black-half div {
background: #000;
color: #fff;
}
.white-half div {
background: #fff;
color: #000;
width:150px;
}
.white-half {
height: 100%;
width: 50%;
overflow: hidden;
position: absolute;
}
.black-half {
height: 100%;
position: absolute;
}
</style>
<div class="container">
<div class="black-half">
<div>Split background and text color</div>
</div>
<div class="white-half">
<div>Split background and text color</div>
</div>
</div>
This question already has answers here:
HTML Div border not showing
(3 answers)
Closed 2 years ago.
I am trying to make a foot print for a cool look, but it won't show
here's my code:
.footprint {
width: 100px;
height: 50px;
border-color: gray;
border: 3px;
border-radius: 20px;
}
<div class="footprint"></div>
welcome to SO!
Somebody already found a solution to your problem here:
CSS Property Border-Color Not Working
A div by default has no border-style and no border-width, therefore the border will not be shown.
This question already has answers here:
draw diagonal lines in div background with CSS
(13 answers)
Closed 4 years ago.
I want is to have something like this effect.
I tried to make a css template by following the picture above, but I don't know how to do it?
Do you can make css effect according to the above picture?
You can use 2D Transformation (https://www.w3schools.com/css/css3_2dtransforms.asp).
.line1 {
width: 112px;
height: 47px;
border-bottom: 1px solid red;
-webkit-transform:
translateY(-20px)
translateX(5px)
rotate(27deg);
position: absolute; }
Here is an example in JSFiddle
This question already has answers here:
How to change text transparency in HTML/CSS?
(10 answers)
Closed 7 years ago.
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.
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
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>