I want to add opacity only to the first div which contains an icon and a heading in another nested div. The second div should remain fully visible (opacity: 1).
Here is the HTML structure:
<div class="row clearfix">
<div class="col-lg-3 col-md-6 col-sm-12 mb-30 parent" (click)="click(item)" *ngFor="let item of services">
<div class="pd-30 bg-secondary border-radius-4 box-shadow text-center height-100-p child">
<div style="margin-top: 30px">
<i class="{{item.icon_class}}" style="font-size:40px;" aria-hidden="true"></i>
</div>
<h5 class="pt-20 mb-30" style="white-space: normal;">{{item.title}}</h5>
</div>
</div>
</div>
CSS Style:
.parent{
opacity: 0.3;
}
.child{
background-color:rgba(0,0,0,1);
}
The current layout can be viewed here.
I've searched online for solutions but found examples that involve closing the first div, which is not feasible due to the presence of *ngFor loop.
Any suggestions on how to achieve this effect?
In addition, there will be a need to implement a feature allowing users to control the opacity percentage as different users may have varying backgrounds where adjustment might be necessary.
Thank you for your help!