wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Mastering HTML and CSS Concepts

Total questions: 75

Worksheet time: 6hrs 15mins

Name
Class
Date
1.

Root element of an HTML document.

a)

<html>

b)

<head>

c)

<body>

d)

<style>

e)

<script>

2.

Which tag is used to define the header section of an HTML document?

a)

<header>

b)

<head>

c)

<footer>

d)

<title>

e)

<meta>

3.

What is the correct HTML element for inserting a line break?

a)

<linebreak>

b)

<break>

c)

<newline>

d)

<lb>

e)

<br>

4.

Which attribute is used to specify the destination of a link in HTML?

a)

src

b)

action

c)

href

d)

target

e)

link

5.

Which HTML element is used to create an unordered list?

a)

<li>

b)

<item>

c)

<list>

d)

<ul>

e)

<ol>

6.

What is the purpose of the <meta> tag in HTML?

a)

To define the title of the document

b)

To create a navigation menu

c)

To link external stylesheets

d)

To provide metadata about the HTML document

e)

To embed images

7.

Which HTML element is used to define a clickable button?

a)

<action>

b)

<click>

c)

<link>

d)

<input type='button'>

e)

<button>

8.

What is the purpose of the <link> tag in HTML?

a)

To embed videos

b)

To create a navigation menu

c)

To define the character set of the document

d)

To link external stylesheets

e)

To provide metadata about the HTML document

9.

Which HTML element is used to create a table?

a)

<list>

b)

<row>

c)

<tab>

d)

<grid>

e)

<table>

10.

What is the correct HTML element for defining a footer in a document?

a)

<aside>

b)

<bottom>

c)

<section>

d)

<footer>

e)

<end>

11.

Which HTML element is used to define a section in a document?

a)

<section>

b)

<article>

c)

<div>

d)

<header>

e)

<main>

12.

What is the correct HTML element for creating a hyperlink?

a)

<url>

b)

<navigate>

c)

<link>

d)

<a>

e)

<href>

13.

Which HTML element is used to define an ordered list?

a)

<item>

b)

<sequence>

c)

<ol>

d)

<ul>

e)

<list>

14.

Which HTML element is used to define a navigation link?

a)

<nav>

b)

<link>

c)

<menu>

d)

<ul>

e)

<header>

15.

What is the purpose of the <script> tag in HTML?

a)

To provide metadata about the HTML document

b)

To create a navigation menu

c)

To embed JavaScript code

d)

To link external stylesheets

e)

To define the character set of the document

16.

Which HTML element is used to create a form for user input?

a)

<label>

b)

<textarea>

c)

<fieldset>

d)

<form>

e)

<input>

17.

Which HTML element is used to define a division or section in a document?

a)

<section>

b)

<block>

c)

<container>

d)

<div>

e)

<group>

18.

What is the purpose of the <title> tag in HTML?

a)

To link external JavaScript files

b)

To create a footer for the document

c)

To specify the title of the document displayed in the browser's title bar

d)

To define the main content of the document

e)

To embed images in the document

19.

Which HTML element is used to create a checkbox input?

a)

<input type='check'>

b)

<input type='box'>

c)

<checkbox>

d)

<input type='checkbox'>

e)

<check>

20.

Which HTML element is used to create a text input field?

a)

<text>

b)

<input type='text'>

c)

<textfield>

d)

<input type='input'>

e)

<input type='string'>

21.

What is the correct HTML element for creating a dropdown list?

a)

<input type='dropdown'>

b)

<list>

c)

<option>

d)

<dropdown>

e)

<select>

22.

Which HTML element is used to define a block of code?

a)

<block>

b)

<script>

c)

<code>

d)

<pre>

e)

<blockquote>

23.

Which HTML element is used to create a radio button?

a)

<button type='radio'>

b)

<input type='select'>

c)

<input type='radio'>

d)

<radio>

e)

<check>

24.

What is the correct HTML element for creating a text area?

a)

<textarea>

b)

<input type='textarea'>

c)

<text>

d)

<field>

e)

<input type='text-area'>

25.

Which HTML element is used to define a footer section in a document?

a)

<aside>

b)

<section>

c)

<end>

d)

<bottom>

e)

<footer>

26.

Set the text color to red, for all <p> elements.

a)

<p> { color: red; }

b)

p { font-color: red; }

c)

p { color: red; }

d)

<p> { font-color: red; }

e)

p { font: red; }

27.

Which HTML element is used to define a table?

a)

<data>

b)

<table>

c)

<tab>

d)

<grid>

e)

<list>

28.

What is the correct HTML element for creating a footer in a document?

a)

<section>

b)

<end>

c)

<footer>

d)

<bottom>

e)

<aside>

29.

Which HTML element is used to define a hyperlink that opens in a new tab?

a)

<a target='_blank'>

b)

<link>

c)

<navigate>

d)

<hyperlink>

e)

<url>

30.

Which HTML element is used to define a form for user input?

a)

<fieldset>

b)

<input>

c)

<submit>

d)

<action>

e)

<form>

31.

What is the correct HTML element for creating a radio button?

a)

<radio>

b)

<input type='button'>

c)

<checkbox>

d)

<input type='radio'>

e)

<input type='check'>

32.

Which HTML element is used to include an image in a document?

a)

<img>

b)

<picture>

c)

<image>

d)

<src>

e)

<photo>

33.

If we want define style for an unique element, then which css selector will we use ?

a)

Id

b)

element

c)

class

d)

child

34.

If we want define style for an unique element, then which css selector will we use ?

a)

Id

b)

element

c)

class

d)

child

35.

Can we align a Block element by setting the left and right margins ?

a)

Yes

b)

Not possible

36.

If we want to wrap a block of text around an image, which css property will we use ?

a)

wrap

b)

push

c)

float

d)

align

37.

If we want to show an Arrow as cursor, then which value we will use ?

a)

pointer

b)

default

c)

arrow

d)

arr

38.

Which element is used in the <HEAD> section on an HTML page, if we want to use an external style sheet file to decorate the page ?

a)

<src>

b)

<link>

c)

<style>

d)

<css>

39.

Which attribute can be added to many HTML elements to identify them as a member of a specific group ?

a)

id

b)

div

c)

class

d)

span

40.

When we write <img src="img.png">, what "img.png" inside double quote implies?

a)

element

b)

attribute

c)

value

d)

operator

41.

Which css property you will use if you want to add some margin between a DIV's border and its inner text ?

a)

spacing

b)

margin

c)

padding

d)

inner-margin

42.

Which CSS property is used to control the text size of an element ?

a)

font-style

b)

text-size

c)

font-size

d)

text-style

43.

The default value of "position" attribute is _________.

a)

fixed

b)

absolute

c)

sticky

d)

relative

44.

How will you make all paragraph elements 'RED' in color ?

a)

.p.all {color: red;}

b)

.* {color: #990000;}

c)

all.p {color: #998877;}

d)

p {color: red;}

45.

By default Hyperlinks are displayed with an underline. How do you remove the underline from all hyperlinks by using CSS code ?

a)

a {text: no-underline;}

b)

a {text-decoration:none;}

c)

a {text-style: no-underline;}

d)

a {text-decoration: no-underline;}

46.

The elements <DIV> and <SPAN> have the following characteristics

a)

Element <DIV> inherits properties defined for <SPAN> in a stylesheet

b)

Elements <SPAN> and <DIV> define content to be inline or block-level

c)

<DIV> and <SPAN> are used as alternatives for the element <P>

d)

<DIV> is used inside element <P>.

47.

Which is not a property of attribute Behaviour of <Marquee> tag?

a)

alternate

b)

blur

c)

scroll

d)

slide

48.

How can you open a link in a new browser window?

a)

<a href="url" new>

b)

<a href="url" target="new">

c)

<a href="url" target="_blank">

d)

<a href="url" target="">

49.

How many different styling techniques are used in CSS?

a)

2

b)

4

c)

3

d)

1

50.

Select the correct among the following for linking an external style sheet.

a)

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

b)

<style rel=“stylesheet” type=“text/css” href=“style.css”>

c)

<link>stylesheet

d)

<link href=“style.css”>stylesheet

51.

Which of the following is the correct CSS syntax?

a)

p:color=green, font-size=15px

b)

{p:color=green, font-size=15px}

c)

p {color:green, font-size:15px;}

d)

p {color:green; font-size:15px;}

52.

If "padding: 10px 5px 20px 0px" is given. What does this represent?

a)

left:10px , top:5px , right:20px , bottom:0px

b)

top:10px , right:5px , bottom:20px , left:0px

c)

right:10px , bottom:5px , left:20px , top:0px

d)

bottom:10px , left:5px , top:20px , right:0px

53.

Which is the correct syntax to set the unordered-list item marker to a square.

a)

<ul style=“list-style-type:square”>

b)

<ul style=“square”>

c)

<ul list-style: “square”>

d)

<ul style=square>

54.

A selectors in CSS is basically used to select the element you want to style.

a)

TRUE

b)

FALSE

55.

Declarations are split into two parts (a property and a value), and are separated by a comma.

a)

TRUE

b)

FALSE

56.

The element selectors select the HTML elements by tag name.

a)

TRUE

b)

FALSE

57.

The id selector is written with the period character (.), followed by the id of an element.

a)

TRUE

b)

FALSE

58.

The class selector selects the element based on the class attribute.

a)

TRUE

b)

FALSE

59.

The class selector is written with a period character (.), followed by the class name.

a)

TRUE

b)

FALSE

60.

The universal selector, selects all the HTML elements on the page.

a)

TRUE

b)

FALSE

61.

The group selector is used to select all the elements with the different style definition.

a)

TRUE

b)

FALSE

62.

Commas are used to separate each selector in grouping.

a)

TRUE

b)

FALSE

63.

1.    What is the correct CSS syntax for making all the <p> elements italic?

a)

p {font-weight:italic;}

b)

p {font-style:italic;}

c)

<p style="text-decoration:italic">

d)

p {text-decoration:italic;}

64.

Choose the correct CSS code to set the list style for unordered lists to “square”, and the list style for ordered lists to “upper-roman”.

a)

ul {list-style-type: square;}

ol {list-style-type: upper-roman;}

b)

ol {list-style-type: square;}

ul {list-style-type: upper-roman;}

c)

ol {list-style-type: square;}

ol {list-style-type: upper-roman;}

d)

ul {list-style-type: square;}

ul {list-style-type: upper-roman;}

65.

Identify the CORRECT CSS syntax to set a background color.

a)

{ body; color: blue }

b)

body { color: blue }

c)

body: color { blue }

d)

{ body; color; blue }

66.

Select from following which would be used to create an ID called header which has a width of 750px, a height of 30px and the color of the text is red.

a)

#header { height: 30px; width:750px; color:red; }

b)

#ID { height: 30px; width:750px; color:red; }

c)

#header { height: 30px, width:750px, color:red; }

d)

.header {height: 30px; width:750px; color:red;}

67.

Choose how does an ID selector is used to set the font size to be 12px.

a)

para1 {font-size: 12px;}

b)

#para1 { font-size: 12px;}

c)

#para1 { font-size: 12px;}

d)

#para1 { font-size: 12px; }

68.

Based on the following script, discover the style rule that will be applied to the HTML element with class named as "center large".

p.center { text-align: center; }

p.large { font-size: 300%; }

a)

All <center> and <large> elements will be center-aligned, with a large font size.

b)

All HTML elements with class="center" and class="large" will be center-aligned, with a large font size.

c)

All <p> elements with class="center large" will be center-aligned, with a large font size.

d)

All <p = center> and <p = large> elements will be center-aligned, with a large font size.

69.

An external style sheet can be written in any text editor. The file should not contain any HTML tags. The style sheet file must be saved with a .css extension. Determine how to link the external styles which defined inside the <head> section of an HTML page.

a)

<a href="stylesheet" type="text/css" href="mystyle.css">

b)

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

c)

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

d)

<link ref="stylesheet" type="text/css" href="mystyle.css">

70.

Choose the codes on how do you set the border for the following paragraph to solid style with red color. 

<html>

<body>

        <p>Hello World!</p>

        <p>These paragraphs are styled with CSS.</p>

</body>

</html>

a)

p {

border-style: solid;

border-color: red;

}

b)

p {

style: solid;

color: red;

}

c)

p {

border: solid;

color: red;

}

d)

p {

border: solid, red;

}

71.

Modify the following code to change font style of paragraph to be italic using CSS inline style.

<html>

<body>

        <h1>CSS Exercise</h1>

        <p>Hello World!</p>

        </body>

        </html>

a)

p {font-style: italic;}

b)

<p style = "font-style: italic">

c)

<p font-type: "italic">

d)

<p style : "font-style = italic">

72.

Choose the codes on how do you set border for table.

a)

table, th, td { border: 1px solid black;}

b)

table { border: 1px solid black;}

c)

table, tr, td { border: 1px solid black;}

d)

table, th, td { border: 2px solid black;}

73.

How do you set for all <h1> elements with red color and centered align by using CSS?

a)

h1 { color: red; text-align: center; }

b)

all.h1 {font-color: red; align: center}

c)

h1.all { color: red; text-align: center; }

d)

h1 { color=red; text-align=center; }

74.

Registration No:

4 lines
75.

Student's Name:

4 lines