Dino Geek, try to help you

How to use opacity in CSS?


The “opacity” property is used in CSS to make an element transparent or semi-transparent. This property takes a value from 0 to 1, where 0 represents completely transparent and 1 represents fully opaque.

Here is the basic syntax to use the opacity property:

```
element { opacity: number;
}
```
The number can be any value from 0 to 1. A value of 0 will make the element completely transparent, while a value of 1 would make the element fully visible.

Here is an example:

```
div { opacity: 0.5;
}
```
In the example above, a div element will appear semi-transparent because its opacity is set to 0.5.

If you want child elements to be unaffected by the opacity of the parent element, you can use RGBA color values for the parent element instead:

```
div { background-color: rgba(0, 0, 0, 0.5); /* The last value is the alpha (transparency) value */
}
```
In the example above, the div will have a semi-transparent black (`rgb(0, 0, 0)`) background color. The child elements will not inherit the transparency of the parent div.


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