Kolory w HTML: Kompletny Przewodnik Dla Poczynających i Doświadczonych Deweloperów 👨‍💻

Diving into the world of web development often involves working with color, and understanding how to use color in HTML is a fundamental skill. Colors can greatly impact user experience and aesthetics of a website, making it an important aspect to consider when designing.

100+ Trending Canva Color Palette Hex Codes 🎨
100+ Trending Canva Color Palette Hex Codes 🎨

HTML provides several ways to specify colors. Let's delve into this topic, exploring the various methods and their applications.

there are four different colors on the waterlily with lily pads in the foreground
there are four different colors on the waterlily with lily pads in the foreground

Color Names in HTML

HTML 4.01 defines 16 standard color names that can be used directly in your code. These colors are a mix of several solid and bright hues.

an image of a color scheme with the letters and numbers on it in different colors
an image of a color scheme with the letters and numbers on it in different colors

Here's a simple list of some of these colors: red, blue, green, yellow, cyan, magenta, black, and white. For a complete list, you can refer to the official W3Schools guide.

Usage with Text Color

the color chart for hex code is shown in blue, green, yellow and pink
the color chart for hex code is shown in blue, green, yellow and pink

The color property can be used to set the color of a text. For example, to set the text color to red, you can use:

<p style="color:red;">This is a red text.</p>

Usage with Background Color

the color code for different colors
the color code for different colors

Similarly, the background-color property can be used to set the background color of an element. For instance, to set the background color to blue, you'd use:

<p style="background-color:blue;">This paragraph has a blue background.</p>

RGB and HEX Colors

an image of some type of webpage with different colors and font options on it
an image of some type of webpage with different colors and font options on it

Sometimes, the named colors might not provide the exact shade you're looking for. In this case, HTML provides two other color systems: RGB and HEX.

Working with RGB

a bunch of different types of font and numbers on a white background with the same color scheme
a bunch of different types of font and numbers on a white background with the same color scheme
the color chart for different colors and numbers
the color chart for different colors and numbers
the color palettes are all different colors in this photo, and there is no image to describe
the color palettes are all different colors in this photo, and there is no image to describe
an image of the back side of a poster with different font and numbers on it
an image of the back side of a poster with different font and numbers on it
Rapid prototyping with CSS keyword colors
Rapid prototyping with CSS keyword colors
Pink Dream
Pink Dream
an iphone screen showing the font and numbers in different colors
an iphone screen showing the font and numbers in different colors
Color Combinaisons: Palette for Graphic Design #193
Color Combinaisons: Palette for Graphic Design #193
the different font and numbers on this website
the different font and numbers on this website
color palette
color palette
the font and numbers in different colors are shown on this page, which shows that each letter
the font and numbers in different colors are shown on this page, which shows that each letter
Gradient Color Palette
Gradient Color Palette
Colour Palette #03
Colour Palette #03
an iphone screen with different colors and sizes
an iphone screen with different colors and sizes
Coastal Blue Colour Palette (Palette #77)
Coastal Blue Colour Palette (Palette #77)
Blue Canva Color Palette Chart 💙 | Trending Blue Hex Codes for Designers
Blue Canva Color Palette Chart 💙 | Trending Blue Hex Codes for Designers
the different font styles and colors for each type of text, including blue, red, green
the different font styles and colors for each type of text, including blue, red, green
Идеальная палитра зеленого: от темного к светлому
Идеальная палитра зеленого: от темного к светлому
some type of font that is in different colors and sizes, with the words below it
some type of font that is in different colors and sizes, with the words below it
50 Canva Color Palette Codes for Beautiful Designs | Canva Color Guide
50 Canva Color Palette Codes for Beautiful Designs | Canva Color Guide

RGB (Red, Green, Blue) is an additive color model in which colors are produced by adding primary colors. In HTML, RGB values are specified with three integers, each ranging from 0 to 255.

For example, to set a color with RGB values 255 (maximum) for each, you can use:

<p style="color:rgb(255,255,255);">This is a white text</p>

HEX Colors

HEX (Hexadecimal) is a number system used to represent colors on a web page. It uses a combination of 6 hexadecimal digits to represent the color.

For instance, setting a color with the hexadecimal values FFFFFF would give you the same white color as above:

<p style="color:#FFFFFF;">This is also a white text</p>

As you delve further into HTML and web design, you'll find these color systems helpful in ensuring your website looks exactly as you intend. Practice and exploration will make you comfortable with each. Happy coding!

Related Articles

W3schools Html Form Attributes W3schools Html Image Gallery W3schools Html Input Type Attributes W3schools Html Tags And Attributes W3 Html Hyperlink Keycode Javascript W3schools W3schools Html Audio Controls W3 Keypress Html To Text Converter W3 Heading Tag In Html With Example