Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Кольори Тексту | Вступ до CSS
Основи CSS
course content

Зміст курсу

Основи CSS

Основи CSS

2. CSS для Тексту
3. Бокс Модель та Відстань між Елементами
4. Флексбокс
5. Декоративні Ефекти

book
Кольори Тексту

Застосування кольору тексту

Колір тексту можна додати до текстового елемента за допомогою CSS-властивості color, надавши їй значення будь-якого кольору. Сучасні браузери підтримують три варіанти значень кольору: RGB, hex і імена кольорів. Розглянемо наступний приклад. Ми застосуємо до тексту червоний колір.

Примітка

Ми можемо знайти кілька цікавих кольорових шаблонів за адресою colorhunt.co.

html

index.html

css

index.css

copy

Note

We can find some exciting color templates at colorhunt.co.

Способи задання кольору

Існує три основні способи: назва кольору, hex, rgb.

Назва кольору

Ми можемо використовувати зарезервовані слова кольору. Список зарезервованих кольорів можна знайти за адресою htmlcolorcodes.com

Color name

We can use reserved color words. The list of reserved colors can be found at htmlcolorcodes.com

Ways to specify color

There are three main ways: color name, hex, rgb.

Color name

We can use reserved color words. The list of reserved colors can be found at htmlcolorcodes.com

Hex format

Hex represents colors as a six-digit code consisting of three pairs of two-digit values. Each pair represents the intensity of red, green, and blue (in that order).

Hex format values range from 00 (no intensity) to FF (maximum intensity).

RGB Format

RGB represents colors as a series of three numbers that correspond to the intensity of red, green, and blue (in that order)

RGB format values range from 0 (no intensity) to 255 (maximum intensity).

Transparency

Transparency in rgb colors can be achieved by using the rgba notation (red, green, blue, alpha), where alpha is the level of opacity or transparency of the color.

The alpha value can range from 0 (completely transparent) to 1 (completely opaque). For example, the RGBA value rgba(0, 255, 0, 0.5) represents a green color with 50% opacity.

html

index.html

css

index.css

copy
question mark

What is the main difference between hex and rgb color notation?

Select the correct answer

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

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 8
Ми дуже хвилюємося, що щось пішло не так. Що трапилося?
some-alt