Dino Geek, try to help you

How to make a background semi-transparent on an image in CSS?


You can use CSS’s `background-color` and `rgba()` properties to make a background semi-transparent. Here’s an example:

```
div { background-color: rgba(255, 255, 255, 0.5); /* Where 255, 255, 255 is white and 0.5 is the opacity (50% transparency) */
}
```

In the `rgba()` property, the first three numbers correspond to the red, green, and blue color channels, and the last number is the alpha channel which controls the opacity. 0 represents fully transparent and 1 represents fully opaque.

Remember to apply the transparent background to a div, not to an image, because images don’t have a background color. You then place your image inside this div.

For example:

```

image

```

and in your css:

```
.transparent-bg { background-color: rgba(255, 255, 255, 0.5); /* semi-transparent white */ padding: 10px;
}

.transparent-bg img { display: block;
}
```


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use