Adding Color

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

Lecture 44:- Adding Color

Color can be added to HTML elements using CSS by setting the "color" property.

The color property can accept a variety of values, including:

  • Named colors: such as "red", "blue", "green", etc.
  • RGB values: specified as rgb(R, G, B), where R, G, and B are integers from 0-255 representing the red, green, and blue components of the color.
  • Hexadecimal values: specified as #RRGGBB, where RR, GG, and BB are pairs of hexadecimal digits representing the red, green, and blue components of the color.
  • HSL values: specified as hsl(H, S, L), where H is an angle from 0-360 representing the hue of the color, S is a percentage representing the saturation of the color, and L is a percentage representing the lightness of the color.

Here is an example of how to add color to an h1 element using RGB values:

cssCopy code

h1 {  color: rgb(255, 0, 0); }

This sets the color of all h1 elements to red.

You can add color to any element by applying a CSS rule with the color property to a selector that targets that element. This can be done either directly in the HTML element using an inline style, or in an external or internal stylesheet.

6. Styling With CSS

2 Comments

@niteshguptav63
niteshguptav63 Nov 17, 2024 at 1:39 PM

I am not able to access videos from second class and further. I have already completed first class

@niteshguptav63
niteshguptav63 Nov 16, 2024 at 10:56 AM

When will I get my course?

@admin79
admin79 Nov 17, 2024 at 1:29 PM

Now, Your query was resolved.

Frequently Asked Questions About Sciaku Courses & Services

Quick answers to common questions about our courses, quizzes, and learning platform

Didn't find what you're looking for?

help_center Contact Support