Dino Geek, try to help you

How to use the ::before pseudo-element in CSS?


The `::before` pseudo-element in CSS is used to insert content before the content of an element. Here is an example of how to use the `::before` pseudo-element:

```
p::before { content: “Read this -”; color: red;
}
```
In this example, we are selecting all `

` tags and before the content of each `

` element, we are inserting the text “Read this -” in red color.

So if you had a paragraph:

```

Lorem ipsum dolor sit amet…


```

After applying the CSS, it would be displayed like this:

```
Read this – Lorem ipsum dolor sit amet…
```
The `content` property is necessary for the `::before` pseudo-element to work. It can contain string, image or nothing.

Because `::before` is a pseudo-element it is not a part of the DOM, so it cannot be manipulated by JavaScript or jQuery. It is also worth noting that pseudo-elements are not recognized in older versions of Internet Explorer (IE8 and below).


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