CSS brightness() function

Definition and usage

CSS brightness() Filter functions are used to adjust the brightness of elements.

  • 0% will make the image completely black
  • 100% (or 1) is the default value, indicating the original image
  • Values over 100% will make the image brighter
  • Values below 100% will make the image darker

Example

Example 1

Make the image brighter or darker than the original image:

#img1 {
  filter: brightness(150%);
}
#img2 {
  filter: brightness(50%);
}

Try it yourself

Example 2

to brightness() with backdrop-filter Combined use of properties:

div.transbox {
  background-color: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: brightness(150%);
  backdrop-filter: brightness(150%);
  padding: 20px;
  margin: 30px;
  font-weight: bold;
}

Try it yourself

CSS Syntax

brightness(amount)
Value Description
amount

Optional. Specify the brightness value, which can be a number or a percentage.

0% will make the element completely black. 100% (or 1) is the default value, indicating the original image (no effect).

Values over 100% will make the image brighter.

Technical details

Version: CSS Filter Effects Module Level 1

Browser support

The numbers in the table represent the first browser version to fully support this function.

Chrome Edge Firefox Safari Opera
18 12 35 6 15

Related pages

Reference:CSS filter property

Reference:CSS blur() function

Reference:CSS contrast() function

Reference:CSS drop-shadow() function

Reference:CSS grayscale() function

Reference:CSS hue-rotate() function

Reference:CSS invert() function

Reference:CSS opacity() function

Reference:CSS saturate() function

Reference:CSS sepia() function