Changing Font Color - Chapter 3B

Comments
Chapter 3B
(This unit covers changing Font’s color through in-line styling)

As I told you earlier, you can use in-line style attribute not only with <p> but with many other tags as well.

Let’s take an example through heading tag. We will change the font color in heading.

The style attribute for changing font color is very much similar to the syntax we use in previous chapter for changing font size. The only thing we need to change is its attribute (i.e font-size) and its value (i.e. 20px) from previous syntax with new attribute (i.e color) and its value (i.e. red) respectively.


For E.g.

For better understanding lets do the changes we need in the code.

Learn_HTML_India_Free_Easy_Get_Jobs_Freshers
Click on the Image to Enlarge

The above example changes the color of font from default (i.e. black) to Blue.

Now Lets do something different, we'll change the font size and color at once. It's simple we can use two or more attributes at once in in-line styling but just separating it with a semi colon (;).

Let's do the changes in above mentioned example only but in the paragraph section.

Learn_To_Code_Free_Freshers_Get_Jobs_Delhi
Click on the image to enlarge


In the above example, we changed the paragraph's font size to 20px and color to red at once through in-line styling.

For any query related to this topic,please leave comment.

Do not spam as it will be removed.

0 comments:

Post a Comment