10 Jul HTML5 Styles
Style any element using the style attribute. Let’s say the color of heading is to be changed, and then it can be easily done with HTML5 Styles.
Example
Here, we are styling h1, h2, and p element,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<!DOCTYPE html> <html> <head> <title>Headings</title> </head> <body> <h1 style="color:red;">Our heading 1</h1> <h2 style="color:green;">Our heading 2</h2> <p style="color:blue;">Understanding level 1 and level 2 heading.</h2> </body> </html> |
Here’s the output,
Let’s see another example here,
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<!DOCTYPE html> <html> <head> <title>Style</title> </head> <body> <h1 style="color:green;">Studyopedia</h1> <p style="color:red;">This content is red.</h2> </body> </html> |
Here’s the output,
No Comments