Зміст курсу
Основи CSS
Основи CSS
Колір Фону
Властивість background-color
За допомогою цієї властивості ми можемо задати колір фону для елемента. Значення може бути в будь-якому форматі: hex, rgb, rgba або зарезервоване слово.
css
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.
css
index.html
index.css
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.
index.html
index.css
linear gradient
Для встановлення лінійного градієнтного кольору фону ми використовуємо
css
linear gradient
To set the linear gradient background color we use:
css
index.html
index.css
Also, we can specify the color percentage in the gradient color.
index.html
index.css
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.
index.html
index.css
radial gradient
Radial gradient works the same way as linear. The only difference is that color starts at the center and spreads outwards.
index.html
index.css
1. У чому основна відмінність між статичним кольором і градієнтним кольором в CSS?
2. Яка різниця між лінійним градієнтом і радіальним градієнтом в CSS?
Дякуємо за ваш відгук!