wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Part 1 Advance HTML and CSS

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

What is the reasoning behind the Don’t Repeat Yourself principle?

a)

It helps you stay under the HTML file character limit

b)

HTML files with repeated code will take a very long time to load

c)

Repeated code makes it harder to read and edit

d)

It makes a more clean and organized website for the user

2.

What are some ways to cut down on repetitive code in your website?

a)

Group together multiple selectors with commas

b)

Strategically plan ahead to make sure the site is coded concisely

c)

Use a div to style multiple elements

d)

All of the above

3.

Which of the following selects all p tags with the class alert and makes them red?

a)

p.alert {

color: red;

}

b)

p {

.alert {

color:red;

}

c)

.alert p{

color: red;

}

d)

p alert{

color: red;

}

4.

How can I select all h1 tags that are immediate children of div tags?

a)

div h1 {

...

}

b)

div > h1 {

...

}

c)

div {

h1 {

...

}

}

d)

.h1 div {

...

}

5.

What is the difference between <span> and <div>?

a)

<span> is better for styling text, while <div> is better for styling images

b)

<span> is for styling multiple elements, while <div> is for styling single elements at a time

c)

<span> is used to group and style inline elements, while <div> creates a line break

d)

<span> is used to style elements, while <div> is used to embed parts of other websites

6.

What is the function of the div tag?

a)

To define a section of an HTML page

b)

To group a block of elements together to format them with CSS

c)

To efficiently apply the same style to several different elements

d)

All of the above

7.

Which of the following correctly uses div to style multiple elements the same way?

a)

<div class="intro">

<h2>Welcome</h2>

<p>Hi, welcome to my page.</p>

</div>

b)

<div>

<h2 class="intro">Welcome</h2>

<p class="intro">Hi, welcome to my page.</p>

</div>

c)

<div>

.intro{

font-size: 16px;

font-style: italic;

}

<h2>Welcome</h2>

<p>Hi, welcome to my page.</p>

</div>

d)

<h2 div class="intro">Welcome</h2>

<p div class="intro">Hi, welcome to my page.</p>

8.

What is the function of the div tag?

a)

To define a section of an HTML page

b)

To group a block of elements together to format them with CSS

c)

To efficiently apply the same style to several different elements

d)

All of the above

9.

Which of the following correctly uses div to style multiple elements the same way?

a)

<div class="intro">

<h2>Welcome</h2>

<p>Hi, welcome to my page.</p>

</div>

b)

<div>

<h2 class="intro">Welcome</h2>

<p class="intro">Hi, welcome to my page.</p>

</div>

c)

<div>

.intro{

font-size: 16px;

font-style: italic;

}

<h2>Welcome</h2>

<p>Hi, welcome to my page.</p>

</div>

d)

<h2 div class="intro">Welcome</h2>

<p div class="intro">Hi, welcome to my page.</p>

10.

What are IFrames?

a)

Videos uploaded to your website

b)

Buttons that link to other websites

c)

HTML pages embedded inside of other HTML pages

d)

The number of views your website has

11.

It is possible to embed any website inside IFrames.

a)

True

b)

False

12.

Which of the following is the proper way to link to the about.html page from the index.html page?

a)

<a href="about">About This Site</a>

b)

<a href="about.html">About This Site</a>

c)

<a href="/about">About This Site</a>

d)

<a href="/about.html">About This Site</a>

13.

Which of the following is the proper way to apply the CSS code inside style.css to the home.html file?

a)

<head>

<style href="style.css"></style>

</head>

b)

<html href="home.html">

c)

<head>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

d)

applyTo {

href: home.html;

}

14.

What do you press to create a new page/file on your site.

3 words all lower case

(a)  

15.

What should your files end with?

a)

.css

b)

html

c)

index

d)

.html

16.

Is this the correct link to link to the style.css page?

<link rel="stylesheet" type="text/css" href="style.css">

a)

Yes

b)

No

17.

Which is correct when using an IFrame tag?

a)

<IFrame>

b)

<iframe>

c)

<Iframe>

18.

What are the 3 ways we select css elements?

a)

href

b)

class

c)

tag

d)

span

e)

id

19.

Is it possible to embed any website inside IFrames?

a)

True

b)

False

20.

What site can you go to learn more about css styling?

a)

Wschools

b)

W2schools

c)

W3schools