Font size
WorksheetsMastering HTML and CSS Concepts
Total questions: 75
Worksheet time: 6hrs 15mins
Root element of an HTML document.
<html>
<head>
<body>
<style>
<script>
Which tag is used to define the header section of an HTML document?
<header>
<head>
<footer>
<title>
<meta>
What is the correct HTML element for inserting a line break?
<linebreak>
<break>
<newline>
<lb>
<br>
Which attribute is used to specify the destination of a link in HTML?
src
action
href
target
link
Which HTML element is used to create an unordered list?
<li>
<item>
<list>
<ul>
<ol>
What is the purpose of the <meta> tag in HTML?
To define the title of the document
To create a navigation menu
To link external stylesheets
To provide metadata about the HTML document
To embed images
Which HTML element is used to define a clickable button?
<action>
<click>
<link>
<input type='button'>
<button>
What is the purpose of the <link> tag in HTML?
To embed videos
To create a navigation menu
To define the character set of the document
To link external stylesheets
To provide metadata about the HTML document
Which HTML element is used to create a table?
<list>
<row>
<tab>
<grid>
<table>
What is the correct HTML element for defining a footer in a document?
<aside>
<bottom>
<section>
<footer>
<end>
Which HTML element is used to define a section in a document?
<section>
<article>
<div>
<header>
<main>
What is the correct HTML element for creating a hyperlink?
<url>
<navigate>
<link>
<a>
<href>
Which HTML element is used to define an ordered list?
<item>
<sequence>
<ol>
<ul>
<list>
Which HTML element is used to define a navigation link?
<nav>
<link>
<menu>
<ul>
<header>
What is the purpose of the <script> tag in HTML?
To provide metadata about the HTML document
To create a navigation menu
To embed JavaScript code
To link external stylesheets
To define the character set of the document
Which HTML element is used to create a form for user input?
<label>
<textarea>
<fieldset>
<form>
<input>
Which HTML element is used to define a division or section in a document?
<section>
<block>
<container>
<div>
<group>
What is the purpose of the <title> tag in HTML?
To link external JavaScript files
To create a footer for the document
To specify the title of the document displayed in the browser's title bar
To define the main content of the document
To embed images in the document
Which HTML element is used to create a checkbox input?
<input type='check'>
<input type='box'>
<checkbox>
<input type='checkbox'>
<check>
Which HTML element is used to create a text input field?
<text>
<input type='text'>
<textfield>
<input type='input'>
<input type='string'>
What is the correct HTML element for creating a dropdown list?
<input type='dropdown'>
<list>
<option>
<dropdown>
<select>
Which HTML element is used to define a block of code?
<block>
<script>
<code>
<pre>
<blockquote>
Which HTML element is used to create a radio button?
<button type='radio'>
<input type='select'>
<input type='radio'>
<radio>
<check>
What is the correct HTML element for creating a text area?
<textarea>
<input type='textarea'>
<text>
<field>
<input type='text-area'>
Which HTML element is used to define a footer section in a document?
<aside>
<section>
<end>
<bottom>
<footer>
Set the text color to red, for all <p> elements.
<p> { color: red; }
p { font-color: red; }
p { color: red; }
<p> { font-color: red; }
p { font: red; }
Which HTML element is used to define a table?
<data>
<table>
<tab>
<grid>
<list>
What is the correct HTML element for creating a footer in a document?
<section>
<end>
<footer>
<bottom>
<aside>
Which HTML element is used to define a hyperlink that opens in a new tab?
<a target='_blank'>
<link>
<navigate>
<hyperlink>
<url>
Which HTML element is used to define a form for user input?
<fieldset>
<input>
<submit>
<action>
<form>
What is the correct HTML element for creating a radio button?
<radio>
<input type='button'>
<checkbox>
<input type='radio'>
<input type='check'>
Which HTML element is used to include an image in a document?
<img>
<picture>
<image>
<src>
<photo>
If we want define style for an unique element, then which css selector will we use ?
Id
element
class
child
If we want define style for an unique element, then which css selector will we use ?
Id
element
class
child
Can we align a Block element by setting the left and right margins ?
Yes
Not possible
If we want to wrap a block of text around an image, which css property will we use ?
wrap
push
float
align
If we want to show an Arrow as cursor, then which value we will use ?
pointer
default
arrow
arr
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 ?
<src>
<link>
<style>
<css>
Which attribute can be added to many HTML elements to identify them as a member of a specific group ?
id
div
class
span
When we write <img src="img.png">, what "img.png" inside double quote implies?
element
attribute
value
operator
Which css property you will use if you want to add some margin between a DIV's border and its inner text ?
spacing
margin
padding
inner-margin
Which CSS property is used to control the text size of an element ?
font-style
text-size
font-size
text-style
The default value of "position" attribute is _________.
fixed
absolute
sticky
relative
How will you make all paragraph elements 'RED' in color ?
.p.all {color: red;}
.* {color: #990000;}
all.p {color: #998877;}
p {color: red;}
By default Hyperlinks are displayed with an underline. How do you remove the underline from all hyperlinks by using CSS code ?
a {text: no-underline;}
a {text-decoration:none;}
a {text-style: no-underline;}
a {text-decoration: no-underline;}
The elements <DIV> and <SPAN> have the following characteristics
Element <DIV> inherits properties defined for <SPAN> in a stylesheet
Elements <SPAN> and <DIV> define content to be inline or block-level
<DIV> and <SPAN> are used as alternatives for the element <P>
<DIV> is used inside element <P>.
Which is not a property of attribute Behaviour of <Marquee> tag?
alternate
blur
scroll
slide
How can you open a link in a new browser window?
<a href="url" new>
<a href="url" target="new">
<a href="url" target="_blank">
<a href="url" target="">
How many different styling techniques are used in CSS?
2
4
3
1
Select the correct among the following for linking an external style sheet.
<link rel=“stylesheet” type=“text/css” href=“style.css”>
<style rel=“stylesheet” type=“text/css” href=“style.css”>
<link>stylesheet
<link href=“style.css”>stylesheet
Which of the following is the correct CSS syntax?
p:color=green, font-size=15px
{p:color=green, font-size=15px}
p {color:green, font-size:15px;}
p {color:green; font-size:15px;}
If "padding: 10px 5px 20px 0px" is given. What does this represent?
left:10px , top:5px , right:20px , bottom:0px
top:10px , right:5px , bottom:20px , left:0px
right:10px , bottom:5px , left:20px , top:0px
bottom:10px , left:5px , top:20px , right:0px
Which is the correct syntax to set the unordered-list item marker to a square.
<ul style=“list-style-type:square”>
<ul style=“square”>
<ul list-style: “square”>
<ul style=square>
A selectors in CSS is basically used to select the element you want to style.
TRUE
FALSE
Declarations are split into two parts (a property and a value), and are separated by a comma.
TRUE
FALSE
The element selectors select the HTML elements by tag name.
TRUE
FALSE
The id selector is written with the period character (.), followed by the id of an element.
TRUE
FALSE
The class selector selects the element based on the class attribute.
TRUE
FALSE
The class selector is written with a period character (.), followed by the class name.
TRUE
FALSE
The universal selector, selects all the HTML elements on the page.
TRUE
FALSE
The group selector is used to select all the elements with the different style definition.
TRUE
FALSE
Commas are used to separate each selector in grouping.
TRUE
FALSE
1. What is the correct CSS syntax for making all the <p> elements italic?
p {font-weight:italic;}
p {font-style:italic;}
<p style="text-decoration:italic">
p {text-decoration:italic;}
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”.
ul {list-style-type: square;}
ol {list-style-type: upper-roman;}
ol {list-style-type: square;}
ul {list-style-type: upper-roman;}
ol {list-style-type: square;}
ol {list-style-type: upper-roman;}
ul {list-style-type: square;}
ul {list-style-type: upper-roman;}
Identify the CORRECT CSS syntax to set a background color.
{ body; color: blue }
body { color: blue }
body: color { blue }
{ body; color; blue }
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.
#header { height: 30px; width:750px; color:red; }
#ID { height: 30px; width:750px; color:red; }
#header { height: 30px, width:750px, color:red; }
.header {height: 30px; width:750px; color:red;}
Choose how does an ID selector is used to set the font size to be 12px.
para1 {font-size: 12px;}
#para1 { font-size: 12px;}
#para1 { font-size: 12px;}
#para1 { font-size: 12px; }
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%; }
All <center> and <large> elements will be center-aligned, with a large font size.
All HTML elements with class="center" and class="large" will be center-aligned, with a large font size.
All <p> elements with class="center large" will be center-aligned, with a large font size.
All <p = center> and <p = large> elements will be center-aligned, with a large font size.
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 href="stylesheet" type="text/css" href="mystyle.css">
<link rel="cascading stylesheet" type="text/css" href="mystyle.css">
<link rel="stylesheet" type="text/css" href="mystyle.css">
<link ref="stylesheet" type="text/css" href="mystyle.css">
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>
p {
border-style: solid;
border-color: red;
}
p {
style: solid;
color: red;
}
p {
border: solid;
color: red;
}
p {
border: solid, red;
}
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>
p {font-style: italic;}
<p style = "font-style: italic">
<p font-type: "italic">
<p style : "font-style = italic">
Choose the codes on how do you set border for table.
table, th, td { border: 1px solid black;}
table { border: 1px solid black;}
table, tr, td { border: 1px solid black;}
table, th, td { border: 2px solid black;}
How do you set for all <h1> elements with red color and centered align by using CSS?
h1 { color: red; text-align: center; }
all.h1 {font-color: red; align: center}
h1.all { color: red; text-align: center; }
h1 { color=red; text-align=center; }
Registration No:
Student's Name:
