-2

I have a div with opacity: 40% . But i want the text in div show with opacity 100%

#box {
Background-color:#000;
Opacity:40%;
}
  • what have you tried to achieve this ? also, css properties are not capitalized. Also `opacity` doesn't have percentage values. `40%` would be `0.4` – Mihai T Nov 12 '18 at 12:02

1 Answers1

0

Used Background color with rgba

#box {
  background-color: rgba(255,0,0,0.4);
  width: 300px;
  height: 300px;
}
<div id="box">Text</div>
Minal Chauhan
  • 6,025
  • 8
  • 21
  • 41