More Practice Questions

More Practice Questions

More Practice Questions

  1. Given the following code; what color is the text in the h2______; What color is the background of the h2 ______?

<head>
<style>

body{color:yellow;background-color:blue}
h2{color:green; background-color:orange}
#notall{color:purple; background-color:pink}

.dog{color:red}
</style>
</head>
<body>
<h2 class=“dog”> I got the A!</h2>
</body>
</html>

  1. Given the following code; what color is the text in the h2______; What color is the background of the h2 ______?

<head>
<style>

body{color:yellow;background-color:blue}
/* h2{color:green; background-color:orange}*/
#notall{color:purple; background-color:pink}

.dog{color:red}
</style>
</head>
<body>

<h1 class=“dog”> I got the A!</h1>
<h2 class=“dog”> I really got the A!</h2>
</body>
</html>

Given the following code; what color is the text in the h2______; What color is the background of the h2 ______?

<head>
<style>

body{color:yellow;background-color:blue}
/* h2{color:green; background-color:orange}*/
#cat{background-color:pink}

.dog{color:red}
</style>
</head>
<body>

<h1 class=“dog”> I got the A!</h1>

<h2 id=“cat”> I really got the A!</h2>
</body>
</html>

1.Given the following code; what is the value of x after each statement is executed? (8 pts.)

x= “ Look ”; The value of x is:______

y= “I got the A! ”; The value of x is:______

x= “So Happy! ”; The value of x is:______

x= x + y + x; The value of x is:______

2.Give an example of a valid variable name______. Write the code to declare that variable. ______Now that you have declared the variable, write the code to give that variable a value that is equal to your first name. ______Your variable now has the data type of ______. Now write the code to give that variable a value that has a different data type. ______What data type does the variable now have?______What type of statement is used to give a variable a value? ______

3.Fill in the blanks with code that will change the text color of the h1, h3, and h2 to greenwhen the h1 is moused over.(8pts)

<h1 onmouseover = “______”> This is fun!!</h1>

<h3______> Yes!</h3>

<h2______> Oh!</h2>

4.Using the code below answer the questions below.

<!DOCTYPE html>

<html>

<head>
<style>

body{ color:yellow }

p{ background-color: purple }

.jam, strong, h5 {color:yellow}

.pig {color:lime}

.good {color:green}

</style>
</head<body>
<p> Paragraph 1. This is my first paragraph. </p>

<p> Paragraph 2. This is my second paragraph. </p>

</body>

</html>

Do not change the code above.

For paragraph 1: (8pts.)

a.) Rewrite the opening paragraph tag for paragraph 1 on the line below using a local style to indent that paragraph.______What color will the text of that paragraph appear on the screen? _____ And what color will the background of the text appear on the screen?_____

For paragraph 2: (6pts.)

b.) Using the code givenabove rewrite the opening paragraph tag for paragraph 2 on the line below to make the text color of the paragraph lime. Do not use a local style. ______What color will the background of the text appear on the screen?_____

Write oneCSS statement to make the background of the page red.

Write oneJavaScript statement to make the background of the page green.

You have an h2 and a paragraph. Write the code so that when you mouse over an h2 the text in the h2 turns red and the paragraph becomes double spaced.