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 Overflow
🌐
W3Schools
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 ...
🌐
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!
🌐
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.
🌐
Udacity
udacity.com › blog › 2021 › 04 › understanding-css-color-and-rgb-colors.html
Understanding CSS Color and RGB Colors | Udacity
April 15, 2021 - These can come in simple value formats such as simple direct namings like “blue,” “red,” or “purple.” You can choose to simply use one of the 145 named color values in CSS but that won’t cover the 16 million colors available in the CSS RGB range.
🌐
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.
Find elsewhere
🌐
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.
🌐
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.
🌐
BrowserStack
browserstack.com › home › guide › how to use css rgba() function correctly?
How to Use CSS rgba() Function Correctly? | BrowserStack
October 22, 2025 - It extends the standard RGB color ... of the rgb() color model, where colors are defined using values for red, green, and blue, each ranging from 0 to 255....
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › css › css-colors
CSS Colors - GeeksforGeeks
November 1, 2025 - Text Color (color): rgb(255, 0, 0); sets the text to red, and font-size: 20px; makes it larger.
🌐
W3C
w3.org › wiki › CSS › Properties › color › RGB
CSS/Properties/color/RGB - W3C Wiki
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.
🌐
Tailscan
tailscan.com › colors
Tailwind CSS Colors
All the Tailwind CSS colors in a handy cheatsheet with hex, hsl and rgb values.
🌐
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.
🌐
Bootstrap
getbootstrap.com › docs › 5.3 › customize › color
Color · Bootstrap v5.3
These new variables are globally set on :root and are adapted for our new dark color mode while our original theme colors remain unchanged. Colors ending in -rgb provide the red, green, blue values for use in rgb() and rgba() color modes.
🌐
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.