Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>CSS Opacity Using RGBA Colors</title> <style> body { background-image: url("/examples/images/pattern.jpg"); } p{ padding: 20px; background: rgba(0, 0, 0, 0.6); color: #fff; font: 18px Arial, sans-serif; } </style> </head> <body> <p>Setting background transparency without affecting the text content.</p> </body> </html>