Languages
[Edit]
EN

CSS - create multi-color border

0 points
Created by:
Savannah
559

In this article, we would like to show you how to create a multi-color border in CSS.

Quick solution:

 

Practical examples

Edit

1. Four arguments

Edit

In this example, we create a four-colored border for a div element. Colors are specified in a clockwise direction starting from top.

Syntax:

Practical example:

2. Three arguments

Edit

In this example, we create a three-colored border for a div element by specifying three arguments:

  1. the first one is for top border color,
  2. the second one for right and left side,
  3. and the third one for the bottom border color.

Syntax:

Practical example:

3. Two arguments

Edit

In this example, we create a two-colored border for a div element by specifying two arguments:

  • the first one for the top and bottom border color,
  • the second one is for the right and left border color.

Syntax:

Practical example:

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join