How to use Filter Property in CSS?

This property is used to define visual effects like blur and brightness to an element.

Ex:-

img { filter: blur(10px);}

Syntax-

  • none – Default value. Specifies no effects
  • blur(px) – This is used to apply blur effect to the image. A larger value will create more blur.
  • brightness(%) – This is used to adjust the brightness of the image. 0% will make the image completely black. 100% is default and represents the original image. Values over 100% will provide brighter results.
  • contrast(%) – This is used to adjust the contrast of the image. 0% will make the image completely black. 100% is default and represents the original image. Values over 100% will provide results with less contrast.
  • grayscale(%) – This is used to convert the image to grayscale. 0% is default and represents the original image. 100% will make the image completely gray. Negative values are not allowed.
  • hue-rotate(deg) – This is used to specify a hue rotation on the image. 0deg is default, and represents the original image. Maximum value is 360deg.
  • invert(%) – This is used to invert the samples in the image. 0% is default and represents the original image. 100% will make the image completely inverted. Negative values are not allowed.
  • opacity(%) – This is used to set the opacity level for the image. This is similar to the opacity property. 0% is completely transparent. 100% is default and represents the original image. Negative values are not allowed.
  • saturate(%) – This is used to saturate the image. 0% will make the image completely un-saturated. 100% is default and represents the original image. Values over 100% provides higher-saturated results. Negative values are not allowed.
  • sepia(%) – This is used to convert the image to sepia. 0% is default and represents the original image. 100% will make the image completely sepia. Negative values are not allowed.
  • url() – The url() function takes the location of an XML file that specifies an SVG filter, and may include an anchor to a specific filter element. filter: url(svg-url#element-id)

Tagged : / / / / /

How to use box-shadow property in CSS?

This property is used to attach one or more shadows to an element.

Syntax: – 

box-shadow: h-shadow v-shadow blur spread color inset

  • h-shadow – The position of the horizontal shadow. Negative values are allowed.
  • v-shadow – The position of the vertical shadow. Negative values are allowed.
  • blur – The blur distance.
  • Spread – Size of shadow. Negative values are allowed
  • color – The color of the shadow
  • none – No shadow. Default
  • inset – Changes the shadow from an outer shadow (outset) to an inner shadow
  • div {box-shadow: 2px 2px 5px red;}
  • div {box-shadow: 2px 2px 5px red, 5px 5px 8px blue;}
Tagged : / / / / / / /