This article mainly introduces the use of RGB color CSS in the detailed, is the basic knowledge of CSS primer learning, the need for friends can refer to the following
RGB Color Model Interpretation
The RGB color model is a way of describing how many red, green, and blue primaries are in a color, like mixing watercolor or oil paints to get some real color that we want.
Imagine if you're going to be given a pure blue, you can't put red and green in this color in order to achieve this. So we set the red and green to 0% and the green to 100%:
RGB (0%, 0%, 100%)
Results:
But what if what you want is not blue but magenta? We can get magenta by mixing 100% red and 100% Blue:
RGB (100%, 0%, 100%)
Results:
From the basis of the color theory, we know that no color is black. So in order to get black we can achieve by setting the red, green, and blue Primary colors to 0%:
RGB (0%, 0%, 0%)
Results:
How to determine the value of an RGB color
We can use Photoshop's color picker feature to get the values of the red, green, and blue primaries of a particular color, but there are also free online tools such as the Color slider and the RGB color Calculator.
Explanation of RGB colors on the W3school:
RGB Color
RGB color values are supported for all browsers.
RGB color values are defined as: rgb (red, green, blue). Each parameter (red, green, and blue) defines the intensity of the color, either an integer between 0 and 255, or a percentage value (from 0% to 100%).
For example, the RGB (0,0,255) value is shown in blue because the blue parameter is set to the highest value (255) and the other is set to 0.
Similarly, the following values define the same color: rgb (0,0,255) and RGB (0%,0%,100%).
Instance
P { background-color:rgb (255,0,0); }
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!
Related recommendations:
Using CSS to achieve shadow effects
Several color gradient patterns commonly used in CSS3