Home > AI > Language > CSS >

opacity

Opacity changes on a parent will get inherited to child elements.

Example :

<div class="hero">
    <h1>Cute kittehs everywhere!</h1>
</div>
<style>
  .hero {
    background-image: url("https://assets.digitalocean.com/labs/images/community_bg.png");
    opacity: 0.5;
}
</style>

Leave a Reply