Skip to content

Buzzingz

Unleashing the Power of Code

  • HTML
  • CSS
  • Toggle search form

CSS Opacity / Transparency

Posted on March 15, 2023March 15, 2023 By shani No Comments on CSS Opacity / Transparency

CSS opacity property is used to adjust the transparency of an element. It can be used to make an element transparent or semi-transparent. The value of the opacity property ranges from 0 to 1, where 0 is completely transparent and 1 is completely opaque.

Example:

div {
  opacity: 0.5; /* semi-transparent */
}

In addition to the opacity property, CSS also provides the RGBA and HSLA color formats that allow specifying the alpha channel (transparency) of a color. The alpha channel is a value between 0 and 1, where 0 is completely transparent and 1 is completely opaque.

Example:

div {
  background-color: rgba(255, 255, 255, 0.5); /* semi-transparent white */
}

In the above example, the alpha value of 0.5 makes the background color of the div element semi-transparent.

CSS opacity can be applied to any element, including text, images, and backgrounds. It can be useful for creating overlay effects, creating a watermark effect, or improving the readability of text on a busy background. However, it is important to use opacity sparingly and judiciously, as it can negatively affect the usability and accessibility of a webpage.

CSS

Post navigation

Previous Post: CSS Pseudo-elements
Next Post: CSS Navigation Bar

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CSS Tutorial

  • Basic CSS Tutorial For Beginners
  • CSS Introduction
  • CSS Syntax
  • CSS Selectors
  • How To Add CSS
  • CSS Comments
  • CSS Colors
  • CSS Backgrounds
  • CSS Borders
  • CSS Margins
  • CSS Margin Collapse
  • CSS Padding
  • CSS Height, Width and Max-width
  • CSS Box Model
  • CSS Outline
  • CSS Text
  • CSS Fonts
  • CSS Web Safe Fonts
  • CSS Font Fallbacks
  • CSS Font Style
  • CSS Font Size
  • CSS Google Fonts
  • CSS Great Font Pairings
  • CSS Icons
  • CSS Links
  • CSS Lists
  • CSS Tables
  • CSS Layout – display: inline-block
  • CSS Layout – float and clear
  • CSS Layout – Horizontal & Vertical Align
  • CSS Layout – Overflow
  • CSS Layout – The display Property
  • CSS Layout – The z-index Property
  • CSS Layout – width and max-width
  • CSS Layout – The position Property
  • CSS Attribute Selectors
  • CSS Image Sprites
  • CSS Image Gallery
  • CSS Dropdowns
  • CSS Horizontal Navigation Bar
  • CSS Vertical Navigation Bar
  • CSS Navigation Bar
  • CSS Opacity / Transparency
  • CSS Pseudo-elements
  • CSS Pseudo-classes
  • CSS Combinators
  • CSS Math Functions
  • CSS The !important Rule
  • CSS Specificity
  • CSS Units
  • CSS Website Layout
  • CSS Counters
  • CSS Forms
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions

Copyright © 2023 Buzzingz.

Powered by PressBook WordPress theme