Dino Geek, try to help you

How to apply a border to an element in CSS?


To apply a border to an element in CSS, you can use the `border` property. The `border` property is a shorthand property for setting the individual border properties in a single place:

```
selector { border: width style color;
}
```

Below are the individual properties:
- `width`: The thickness of the border (ex: 2px, 1em, etc.).
- `style`: The style of the border (ex: solid, dotted, dashed, double, groove, ridge, inset, outset, none, hidden).
- `color`: The color of the border (color name, hex, rgb, rgba, hsl, etc.).

Here is an example:

```
div { border: 2px solid black;
}
```

In this example, it is applied a border to `

` elements. The border is 2 pixels thick, it is a solid line, and it is black.

Remember that if you want to apply the border to a specific side of your element, rather than all around it, you can use the `border-top`, `border-right`, `border-bottom`, or `border-left` properties, and follow the same format.


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