Like this
body {
background-color: rgb(255,255,0);
}
To add opacity, use rgba. Where 1 is 100% opacity.
body {
background-color: rgba(255,255,0, 1);
}
Answer from Carl Binalla on Stack OverflowW3Schools
w3schools.com › css › css_colors_rgb.asp
CSS RGB and RGBA Colors
CSS Reference CSS Selectors CSS ... CSS Color Values CSS Default Values CSS Browser Support ... An RGB color value represents RED, GREEN, and BLUE light sources....
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Values › color_value › rgb
rgb() - CSS | MDN
When using relative color syntax inside an rgb() function, the browser converts the origin color into an equivalent RGB color (if it is not already specified as such). The color is defined as three distinct color channel values — r (red), g (green), and b (blue) — plus an alpha channel ...
Videos
04:13
Learn CSS colors in 4 minutes! 🖌️ - YouTube
06:11
How to use RGB colors in CSS - YouTube
CSS Colors Tutorial for Beginners - YouTube
🎨 CSS Colors Tutorial - HSL, RGB, HEX Explained with Examples ...
04:39
How to use CSS color values (RGB, keywords, HSL) - YouTube
10:41
Build smarter color systems with relative colors - YouTube
HTML Color Codes
htmlcolorcodes.com
HTML Color Codes
Get HTML color codes, Hex color codes, RGB, HSL and OKLCH values with our color pickers, color wheel, color chart and HTML color names. Let's go!
RapidTables
rapidtables.com › web › color › RGB_Color.html
RGB Color Codes Chart 🎨
RGB color codes chart, RGB color picker, RGB color table.
W3Schools
w3schools.com › colors › colors_rgb.asp
Colors RGB and RGBA
Each parameter (red, green, and blue) defines the intensity of the color with a value between 0 and 255. For example, rgb(255, 0, 0) is displayed as red, because red is set to its highest value (255), and the other two (green and blue) are set to 0.
RGB Color Picker
rgbcolorpicker.com
RGB Color Picker
RGB colors in CSS can be specified by using the following syntax: rgb(<red_value>, <green_value>, <blue_value>), where each of the three values is an integer ranging from 0 to 255.
CSS-Tricks
css-tricks.com › almanac › functions › r › rgb
rgb() | CSS-Tricks
February 22, 2025 - The CSS rgb() function represents color in the sRGB space specifying its redness (r), greenness (g), and blueness (b), and an optional transparency value (alpha-value) separated with a forward slash.
Top answer 1 of 4
8
Like this
body {
background-color: rgb(255,255,0);
}
To add opacity, use rgba. Where 1 is 100% opacity.
body {
background-color: rgba(255,255,0, 1);
}
2 of 4
3
you need to add this rule to your css rgb(0,0,0) or rgba(0,0,0,0.5) to opacity.
body {
background-color: rgb(255,255,0);
color: rgba(0,0,0,0.7);
}
Josh W. Comeau
joshwcomeau.com › css › color-formats
Color Formats in CSS - hex, rgb, hsl, lab • Josh W. Comeau
Recently, however, we've been getting some new color formats in CSS. They're pretty compelling. Let's talk about them. So, this blog post is about color formats, the syntaxes we use to specify colors. All of the true color formats we've seen so far — rgb(), hex codes, and hsl() — are all bound by the “standard RGB color space”, commonly abbreviated as sRGB.
Simmons University
web.simmons.edu › ~grabiner › comm244 › weekthree › css-colors.html
Defining Colors in CSS
RGB works the opposite of CMYK, in that none of the colors actually equals black and all of the colors equals white. Don't worry much about the technical details, just how to use them. The CSS syntax for using RGB colors is a little different than we've seen before.
Wikipedia
en.wikipedia.org › wiki › Web_colors
Web colors - Wikipedia
2 weeks ago - The bytes represent the red, green, and blue components of the color. (The optional fourth byte refers to alpha channel.) One byte represents a number in the range 00 to FF (in hexadecimal notation), or 0 to 255 in decimal notation.
W3C
w3.org › wiki › CSS › Properties › color › RGB
CSS/Properties/color/RGB - W3C Wiki
July 21, 2011 - em { color: rgb(255,0,0) } /* integer range 0 - 255 */ em { color: rgb(300,0,0) } /* clipped to rgb(255,0,0) */ em { color: rgb(255,-10,0) } /* clipped to rgb(255,0,0) */ em { color: rgb(110%, 0%, 0%) } /* clipped to rgb(100%,0%,0%) */ CSS Color defines the RGB color values in 4.2.1.
W3Schools
w3schools.com › css › css3_colors.asp
CSS Colors
CSS supports 140+ color names, HEX values, RGB values, RGBA values, HSL values, HSLA values, and opacity.
Quackit
quackit.com › css › css_color_codes.cfm
CSS Color Codes
Each color can be represented in many different ways. For example blue can also be represented as #0000ff, #00f, rgb(0,0,255) and many other ways. It doesn't matter which one you choose as long as it's a valid color. You can apply any of these colors to a website or blog by using the relevant ...
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Guides › Colors › Color_values
CSS color values - CSS | MDN
December 16, 2025 - There are two primary ways of defining an RGB color by its red, green, and blue components in CSS — hexadecimal and rgb() values. Like named colors, these methods use the RGB model and are associated with the sRGB (srgb) color space.