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,

<!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,

HTML5 Styles for heading and text

Let’s see another example here,

<!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,

HTML5 Styles

HTML5 Title
HTML5 Canvas
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment