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 ...
Discussions

html - How to set CSS RGB colors using numeric values? - Stack Overflow
I'm in new to HTML/CSS. I can see that there are various ways of setting color code in a CSS style description i.e. by name e.g. yellow or by hex code #ffff00. I see there are also numeric equivale... More on stackoverflow.com
🌐 stackoverflow.com
Why is hex code color so prevalent instead of HSL or RGB?
It's in moments like this I wish mods would just let me set my flair to something like "y'all make me feel old". I can't speak for other websites, but I can talk about my own sins. I just know how to "think" in hex codes. So naturally I tend to go for that. Turns out that's just what I was taught and I've been using since. It's not deprecated in any way and works 99.99999% of the time for what I do. Even if the color comes from a Figma design and I can use any value, I'll reach for the hex unless there's opacity involved. HSL support was an addition to the CSS 3 spec later. When I graduated we were still taught web safe colors and how to design with only 216 colors in mind. So I really don't know about HSL being more human readable. I can use it. I understand it, but I can't "think" in HSL yet. I just know that with 6 characters I can express pretty much all the colors I need. So I think it comes down to: personal preference simplicity/tradition Edit: Turns out you can set a custom flair More on reddit.com
🌐 r/webdev
32
10
August 1, 2022
How to use #ARGB colors in HTML
You can use RGBA in CSS instead of hex like so: color:rgba(0,0,0,0.5); Which is 50% black. Depending how your DB is formatted you may need to find a way of reordering the values as the alpha is declared at the end, not the beginning as in your post. More on reddit.com
🌐 r/HTML
18
4
March 12, 2019
Is it OK to use color names instead of hex color codes in terms of compatibility for all browsers?
I reckon you'll be fine: https://caniuse.com/mdn-css_types_color_named-color But also, probably don't use named colours because they're just a bit ugly most of the time. More on reddit.com
🌐 r/css
26
8
November 20, 2023
🌐
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.
Find elsewhere
🌐
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() color function represents color in the sRGB color space specifying their redness (r), greenness (g), and blueness (b), and an optional transparency value.
🌐
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
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.
🌐
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.