Use four values for red, green, blue, and alpha: rgba(20, 80, 160, 0.5) makes a blue color 50% opaque. The modern equivalent is rgb(20 80 160 / 50%). Both forms are valid CSS; for a translucent background with opaque text, put alpha on the background color rather than applying opacity to the whole element.
How to write an RGBA color
The traditional syntax uses comma-separated red, green, blue, and alpha components:
As an Amazon Associate I earn from qualifying purchases.
rgba(red, green, blue, alpha)
For example:
.notice {
background-color: rgba(20, 80, 160, 0.5);
}
In this common numeric notation, each RGB channel is a value from 0 through 255. Alpha controls transparency: use a number from 0 to 1 or a percentage from 0% to 100%.
Recommended Free Tools
0or0%: fully transparent.0.5or50%: half opaque.1or100%: fully opaque.
Alpha is not a 0–255 channel. If you omit alpha in an RGB color, it defaults to fully opaque. See MDN’s RGB function reference and the CSS Color Module Level 4 specification.
#1 Best Overall
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Use modern slash-alpha syntax when you prefer it
CSS also allows alpha after a slash, with spaces separating the RGB channels:
.notice {
background-color: rgb(20 80 160 / 50%);
}
This produces the same color and transparency as rgba(20, 80, 160, 0.5). In the modern form, do not use commas between the channels or combine comma-separated syntax with a slash. Although the modern form uses the name rgb(), it still supports alpha.
Rank #2
Keep text opaque while making a background translucent
Apply alpha to the background color itself, then set the text color separately:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
.card {
background-color: rgb(15 25 40 / 85%);
color: white;
}
The background color is translucent, while the text remains opaque. Avoid setting opacity on .card when only its background should fade: element-wide opacity affects the element’s rendered contents too.
Rank #3
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Choose between RGBA, slash-alpha RGB, and alpha hex
| Format | Example | When it may fit |
|---|---|---|
| Comma-separated RGBA | rgba(0, 0, 255, 0.5) |
Alpha is explicit in the function name and familiar to many developers. |
| Modern slash-alpha RGB | rgb(0 0 255 / 50%) |
A readable choice when writing modern CSS color syntax. |
| Hex with alpha | #ff000080 |
Compact when your design values are already hexadecimal; the final byte encodes alpha. |
In eight-digit hex notation, the form is #RRGGBBAA: the last byte, AA, is alpha. 00 is fully transparent and ff fully opaque. For example, #ff000080 is an approximately half-transparent red. See MDN’s hex color reference.
rgba() has not been removed; it remains a valid legacy alias of rgb(). For newer CSS, slash-alpha syntax is another option. Check the browser compatibility information linked from MDN’s RGB reference if your project has a specific browser-support matrix.
Rank #4
Common mistakes and fixes
- Using 128 for half alpha: Alpha is a number from 0 to 1 or a percentage. Use
0.5or50%, not an 8-bit value. - Fading the text along with the background: Use alpha in
background-color, notopacityon the containing element. - Mixing syntaxes: Write legacy RGBA with commas, such as
rgba(20, 80, 160, 0.5), or modern RGB with spaces and a slash, such asrgb(20 80 160 / 50%). - Assuming transparent means a particular visible color: A transparent color lets what is behind it show through; the resulting appearance depends on the background beneath it.
See a rendered result with ScreenshotNeo
You can inspect a page with translucent CSS in a real browser screenshot. ScreenshotNeo is a website screenshot API and MCP server; its one-call capture can save you from setting up a browser for this check.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutecurl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Replace the example URL with a publicly accessible page you want to capture, and provide your API key. See the ScreenshotNeo documentation for API options.
Best Value
- Cookie banners are accepted and removed, along with known consent-platform banners, newsletter popups, and chat widgets; each cleanup step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. Responses identify the page verdict and billing status in headers.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents. - The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try it with 1,000 screenshots a month and no card.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




