Search Header Logo

HTML Classes and ID

Authored by Preston Rowland

Computers

9th - 12th Grade

Used 15+ times

HTML Classes and ID
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Create a class selector named "special".

Add a color property with the value "blue" inside the "special" class.

<style>

.special {color:blue ;}

</style>

<style>

.class {color:#0000ff ;}

</style>

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Add the correct class to make the H1 element red, given the following head element.

<head>

<style>

.mystyle {color:red;}

</style>

</head>

<h1 color="red">My Home Page</h1>

<h1 class="mystyle">My Home Page</h1>

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Add two classes to the H1 element, to make the background pink and the color red, given the following head element.

<head>

<style>

.intro {background:pink;}

.special {color:red;}

</style>

</head>

<h1 class="intro special">My Home Page</h1>

<h1 bg="pink" color="red">My Home Page</h1>

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Add the correct HTML attribute to make the H1 element red, given the following head element.

<style>

#myheader {color:red;}

</style>

<h1 id="red">My Home Page</h1>

<h1 id="myheader">My Home Page</h1>

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Create an id selector named "special".

Add a color property with the value "blue" inside the "special" declaration block.

<style>

#special {color:blue;}

</style>

<style>

#id-special {color:green;}

</style>

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?