115k views
3 votes
Add "HTML" as most important heading and "computer science as least important heading . Change the color of all heading to red and align the heading to center using css styles..

User Hbhakhra
by
4.4k points

1 Answer

7 votes

Answer:

The solution is as follows:

<!DOCTYPE html>

<html>

<head>

<style>

h1, h2, h3, h4, h5, h6 {

color: red;

text-align: center;

}

</style>

</head>

<body>

<h1>HTML</h1>

<h2>Heading 2</h2>

<h3>Heading 3</h3>

<h4>Heading 4</h4>

<h5>Heading 5</h5>

<h6>computer science as least important heading</h6>

</body>

</html>

Step-by-step explanation:

The most important heading in html is defined using h1 while the least is defined using h6.

As far as this question is concerned, h2 to h5 are not needed; however, I've included them as part of the solution.

The CSS Part of the solution

<style>

h1, h2, h3, h4, h5, h6 {

color: red; -> This changes the color of all headings (h1 to h6) to red

text-align: center; -> This centralizes all headings (h1 to h6)

}

</style>

--------------------- End of CSS

The html part of the solution

All headings from the most important (h1) to the least important (h6) are defined here

<h1>HTML</h1>

<h2>Heading 2</h2>

<h3>Heading 3</h3>

<h4>Heading 4</h4>

<h5>Heading 5</h5>

<h6>computer science as least important heading</h6>

User Partial
by
4.6k points