Eduaction Management 959 Lahore
Code With Jahangir
CSS Images
FREE COURSES
FREE CERTIFICATE
CSS Images
Images help in enhancing website looks therefore CSS provided image styling at our convenience.
Syntax:
Various CSS rules that can be applied to the image are:
Image Border Radius
Rounding the edges of the image.
Eg:
Output:
Image Responsiveness
By setting the height as auto you can make the image responsive.
Eg:
Output:
Apart from this, you can also use commands like fit-command, max-content, etc to let the image fit according to its value.
Image Opacity
This property controls the transparency of the image visible on the website and ranges from 0 to 1.
Eg:
Output:
Image Filter
Just like the filters on your phone camera, you can do the same with the images you use on your website.
Eg:
Output:
Other commonly known filters present in CSS are blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), opacity(), saturate(), sepia(), etc. As these are just functions therefore we can pass “%” as the parameters to control how much the filter affects the image.
Eduaction Management 959 Lahore
Code With Jahangir
CSS Images
FREE COURSES
FREE CERTIFICATE