Open In App

How to make Element transparent in CSS ?

Last Updated : 30 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The CSS opacity Property is used to adjust the transparency of an element. It controls the level of opacity or see-through effect, allowing you to make elements partially or fully transparent.

Note: The opacity property accepts values between 0 (completely transparent) and 1 (completely opaque).

Syntax

.transparent-box {
opacity: 0.7;
}

Features

  • Transparency Control: opacity allows you to control how transparent or opaque an element is.
  • Values Range: Values range from 0 (completely transparent) to 1 (completely opaque).
  • Affects Child Elements: The opacity of an element affects not only the element itself but also its child elements.
  • Use Cases: Useful for creating subtle background overlays, fade-in/fade-out effects, or making certain elements less prominent.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads