Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Background Color | Decorative Effects
CSS Fundamentals

Background ColorBackground Color

The background color of a website plays a crucial role in setting the tone and atmosphere of the site. It's one of the primary visual elements that users will see when they visit your site, and it can greatly impact the overall look and feel of the website.

background-color property

We can set background color for an element with help of this porperty. The value can be in any format: hex, rgb, rgba or reserved word.

html

index.html

css

index.css

js

index.js

static vs gradient color

Static color refers to a single color value that is applied uniformly to an element, such as red or #0000FF . On the other hand, gradient color involves blending two or more colors together to create a smooth transition between them.

html

index.html

css

index.css

js

index.js

With gradient color, we can create more visually attractive and dynamic designs than with static color. Let's consider different ways to declare gradients.

linear gradient

To set the linear gradient background color we use:

html

index.html

css

index.css

js

index.js

Also, we can specify the color percentage in the gradient color.

html

index.html

css

index.css

js

index.js

solid linear gradient

We get striped background color if we specify the same percentage for adjacent colors. Let's run the example to get what the difference is.

html

index.html

css

index.css

js

index.js

radial gradient

Radial gradient works the same way as linear. The only difference is that color starts at the center and spreads outwards.

html

index.html

css

index.css

js

index.js

1. What is the main difference between static color and gradient color in CSS?
2. What is the difference between linear gradient and radial gradient in CSS?

What is the main difference between static color and gradient color in CSS?

Виберіть правильну відповідь

What is the difference between linear gradient and radial gradient in CSS?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 5. Розділ 1

Background ColorBackground Color

The background color of a website plays a crucial role in setting the tone and atmosphere of the site. It's one of the primary visual elements that users will see when they visit your site, and it can greatly impact the overall look and feel of the website.

background-color property

We can set background color for an element with help of this porperty. The value can be in any format: hex, rgb, rgba or reserved word.

html

index.html

css

index.css

js

index.js

static vs gradient color

Static color refers to a single color value that is applied uniformly to an element, such as red or #0000FF . On the other hand, gradient color involves blending two or more colors together to create a smooth transition between them.

html

index.html

css

index.css

js

index.js

With gradient color, we can create more visually attractive and dynamic designs than with static color. Let's consider different ways to declare gradients.

linear gradient

To set the linear gradient background color we use:

html

index.html

css

index.css

js

index.js

Also, we can specify the color percentage in the gradient color.

html

index.html

css

index.css

js

index.js

solid linear gradient

We get striped background color if we specify the same percentage for adjacent colors. Let's run the example to get what the difference is.

html

index.html

css

index.css

js

index.js

radial gradient

Radial gradient works the same way as linear. The only difference is that color starts at the center and spreads outwards.

html

index.html

css

index.css

js

index.js

1. What is the main difference between static color and gradient color in CSS?
2. What is the difference between linear gradient and radial gradient in CSS?

What is the main difference between static color and gradient color in CSS?

Виберіть правильну відповідь

What is the difference between linear gradient and radial gradient in CSS?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 5. Розділ 1
some-alt