WorksheetsISPFL7 - BSIS4A - Midterm Exam
Total questions: 100
Worksheet time: 1hrs 13mins
Name
Class
Date
1.
What does HTML stand for?
a)
Hyper Text Markup Language
b)
High-Level Text Markup Language
c)
Hyperlink and Text Markup Language
d)
Home Tool Markup Language
2.
Which of the following is used to create a hyperlink in HTML?
a)
<link>
b)
<a>
c)
<img>
d)
<p>
3.
Which attribute is used to specify an image file in HTML?
a)
src
b)
href
c)
alt
d)
img
4.
What is the correct way to create a line break in HTML?
a)
<break>
b)
<br />
c)
<lb>
d)
<line>
5.
What is the purpose of the <head> section in an HTML document?
a)
To define the visible content of the webpage
b)
To include metadata and links to external resources
c)
To display the document title
d)
To insert an image in the page
6.
Which of the following is not a valid HTML tag?
a)
<div>
b)
<header>
c)
<footer>
d)
<note>
7.
How do you create a numbered list in HTML?
a)
<ul>
b)
<ol>
c)
<dl>
d)
<list>
8.
Which tag is used to display a large heading?
a)
<h1>
b)
<heading>
c)
<title>
d)
<h6>
9.
Which element is used to create a form in HTML?
a)
<input>
b)
<form>
c)
<textarea>
d)
<button>
10.
What does the alt attribute in an <img> tag specify?
a)
Image resolution
b)
Image description for accessibility
c)
Image size
d)
Image format
11.
Which of the following is correct for adding CSS styles within an HTML document?
a)
<link>
b)
<meta>
c)
<style>
d)
<head>
12.
How do you add a comment in HTML?
a)
<!-- comment -->
b)
// comment
c)
/* comment */
d)
<comment> comment </comment>
13.
What does the <p> tag stand for?
a)
Paragraph
b)
Padding
c)
Page break
d)
Preformatted text
14.
How can you open a link in a new browser tab or window?
a)
Using the newtab attribute
b)
By setting target="_blank"
c)
By using target="_new"
d)
Adding link="new"
15.
Which tag is used to define a table row?
a)
<tr>
b)
<td>
c)
<table>
d)
<row>
16.
What is the correct syntax for creating an email link in HTML?
a)
<a href="email@example.com">
b)
<a email="email@example.com">
c)
<a href="mailto:email@example.com">
d)
<mail href="email@example.com">
17.
What is the purpose of the <!DOCTYPE> declaration in HTML?
a)
It defines the document type
b)
It defines the character set
c)
It links to an external stylesheet
d)
It creates a clickable button
18.
Which tag is used to embed an image in HTML?
a)
<src>
b)
<img>
c)
<image>
d)
<icon>
19.
What is the default method of submitting form data?
a)
POST
b)
GET
c)
SEND
d)
RECEIVE
20.
How can you specify the metadata for an HTML document?
a)
Using the <meta> tag in the <body> section
b)
Using the <meta> tag in the <head> section
c)
Using the <meta> tag outside the <html> tag
d)
Metadata is not used in HTML
21.
HTML documents must always include a <!DOCTYPE> declaration.
a)
True
b)
False
22.
The <img> tag can be used without specifying the src attribute.
a)
True
b)
False
23.
The <title> tag is used to specify the title of the webpage in the browser tab.
a)
True
b)
False
24.
HTML allows multiple <head> elements in a single document.
a)
True
b)
False
25.
The <form> tag is used to create a table in HTML.
a)
True
b)
False
26.
The <a> tag is used to create links to other web pages.
a)
True
b)
False
27.
The alt attribute in an image tag is optional and has no effect on accessibility.
a)
True
b)
False
28.
The <meta> tag is used to include scripts on the webpage.
a)
True
b)
False
29.
HTML is case-sensitive.
a)
True
b)
False
30.
Inline frames (<iframe>) are used to embed another HTML document within the current document.
a)
True
b)
False
31.
What does CSS stand for?
a)
Computer Style Sheets
b)
Cascading Style Sheets
c)
Colorful Style Sheets
d)
Creative Style Sheets
32.
What is the purpose of CSS?
a)
To structure the content of web pages
b)
To style and layout web pages
c)
To store data on the server
d)
To add animations to websites
33.
Which of the following is NOT a CSS selector?
a)
ID selector
b)
Class selector
c)
Element selector
d)
Data selector
34.
In which part of the HTML document should the <style> tag be placed?
a)
<body>
b)
<header>
c)
<head>
d)
<footer>
35.
What does the term "cascading" in CSS refer to?
a)
The structure of the stylesheet
b)
The order in which rules are applied
c)
The speed at which CSS loads
d)
The way browsers process images
36.
Which property is used to change the text color in CSS?
a)
text-color
b)
color
c)
font-color
d)
text-style
37.
Which of the following is a valid CSS rule?
a)
h1 {color: red;}
b)
p (color: blue);
c)
body {text-color: green}
d)
h2 [color: yellow]
38.
Which of the following media types is NOT supported by CSS?
a)
screen
b)
print
c)
braille
d)
pdf
39.
Which is the correct way to link an external CSS file?
a)
<link href="styles.css" rel="stylesheet">
b)
<stylesheet link="styles.css">
c)
<style href="styles.css">
d)
<link src="styles.css">
40.
Which CSS property controls the size of text?
a)
font-size
b)
text-size
c)
text-style
d)
font-weight
41.
How are class selectors defined in CSS?
a)
By using a dot (.) followed by the class name
b)
By using a hashtag (#) followed by the class name
c)
By using the element name
d)
By using a dollar sign ($) followed by the class name
42.
What is the use of !important in CSS?
a)
To define important HTML elements
b)
To give the property the highest priority
c)
To make styles dynamic
d)
To add comments in CSS
43.
Which CSS selector is used to target an element with a specific id?
a)
.classname
b)
tagname
c)
#idname
d)
* (universal selector)
44.
What is the primary advantage of using an external CSS file?
a)
Faster loading times
b)
Consistent styling across multiple pages
c)
More colors can be used
d)
It requires no linking to HTML
45.
What is the purpose of a CSS reset?
a)
To change the font styles
b)
To remove default browser styling
c)
To set the page background color
d)
To clear the cache of the CSS
46.
What is the default positioning of HTML elements?
a)
static
b)
relative
c)
absolute
d)
fixed
47.
Which of the following is an advantage of responsive design?
a)
Faster website load times
b)
Adapting web pages for all devices
c)
Higher SEO rankings
d)
Easier debugging
48.
CSS stands for Cascading Style Sheets.
a)
True
b)
False
49.
Inline CSS is the best practice for managing styles across a large website.
a)
True
b)
False
50.
The specificity of a CSS rule depends on the type of selector used.
a)
True
b)
False
51.
CSS can only be used with HTML and cannot style other XML-based documents.
a)
True
b)
False
52.
The !important rule in CSS can override other styles but cannot override inline styles.
a)
True
b)
False
53.
A class can be used multiple times in an HTML document, while an ID must be unique.
a)
True
b)
False
54.
CSS properties like margin and padding are inherited by child elements.
a)
True
b)
False
55.
Browsers have their own default stylesheets that can affect how a webpage looks if no CSS is applied.
a)
True
b)
False
56.
The external CSS file can be linked in the <body> section of the HTML document.
a)
True
b)
False
57.
Which property is used to specify the text color in CSS?
a)
font-color
b)
color
c)
text-color
d)
background-color
e)
N/A
58.
Which of the following is NOT a valid font-size value?
a)
medium
b)
large
c)
xx-large
d)
super-large
e)
N/A
59.
The font-family property allows you to:
a)
List fonts separated by spaces
b)
List fonts separated by commas
c)
List fonts separated by semicolons
d)
Define only one font
e)
N/A
60.
What does the font-weight: 700; represent?
a)
Thin text
b)
Bold text
c)
Normal text
d)
Extra bold text
e)
N/A
61.
Which CSS property is used to make text italic?
a)
font-style: italic
b)
font-weight: bold
c)
text-decoration: italic
d)
font-style: bold
e)
N/A
62.
Which value is NOT valid for the text-decoration property?
a)
underline
b)
overline
c)
none
d)
italic
e)
N/A
63.
What does the text-align: justify; property do?
a)
Aligns text to the left
b)
Aligns text to the right
c)
Aligns text to both edges
d)
Centers the text
e)
N/A
64.
If you set margin: 10px;, what will happen?
a)
Only top margin
b)
All sides margin
c)
No margin
d)
Only left margin
e)
N/A
65.
Which CSS property would you use to control the transparency of an element?
a)
visibility
b)
opacity
c)
display
d)
overflow
e)
N/A
66.
Which of the following statements about collapsing margins is TRUE?
a)
Only occur with inline elements
b)
Occur with elements in table
c)
Occur with adjacent block elements
d)
Increase spacing
e)
N/A
67.
Which unit is NOT used for setting width and height?
a)
px
b)
em
c)
kg
d)
%
68.
What does display: none; do to an element?
a)
Hides element but reserves space
b)
Removes element from page layout
c)
Makes element transparent
d)
Converts element into inline element
e)
N/A
69.
The cursor: pointer; property is used to:
a)
Change cursor to pointer
b)
Move element to different location
c)
Add underline to text
d)
Float element to right
e)
N/A
70.
Which of the following is TRUE about padding in CSS?
a)
Adds space outside border
b)
Adds space between content & border
c)
Defines border thickness
d)
Same as margin
e)
N/A
71.
What does the float property do?
a)
Float to top
b)
Float to left or right
c)
Make text bold
d)
Clear element content
e)
N/A
72.
The color property is used to set the background color of an element.
a)
True
b)
False
73.
font-family should always include a generic font like sans-serif or serif.
a)
True
b)
False
74.
The font-weight property only accepts named values like bold or normal.
a)
True
b)
False
75.
text-decoration: blink; is commonly used and supported across all modern browsers.
a)
True
b)
False
76.
Width and height properties can be applied to inline elements without changing display style.
a)
True
b)
False
77.
Margins and padding can have different values for each side of an element.
a)
True
b)
False
78.
The opacity property controls the visibility of an element.
a)
True
b)
False
79.
The display property can completely hide an element from the layout.
a)
True
b)
False
80.
The overflow: hidden; property prevents content from overflowing an element's bounds.
a)
True
b)
False
81.
What is JavaScript mainly used for?
a)
Server-side
b)
Client-side scripting
c)
Database management
d)
File handling
82.
What type of language is JavaScript?
a)
Compiled
b)
Interpreted
c)
Assembly
d)
Machine
83.
Which keyword is used to declare a variable in JavaScript?
a)
let
b)
var
c)
const
d)
All of the above
84.
What does DOM stand for?
a)
Document Object Model
b)
Data Object Model
c)
Dynamic Object Model
d)
Document Online Model
85.
What is the purpose of using the prompt() function in JavaScript?
a)
Display a message
b)
Ask for user input
c)
Confirm an action
d)
Validate form data
86.
Which method is used to create an alert box in JavaScript?
a)
alert()
b)
confirm()
c)
prompt()
d)
showAlert()
87.
How do you write comments in JavaScript?
a)
// This is a comment
b)
<!-- This is a comment -->
c)
# This is a comment
d)
/* This is a comment */
88.
What does the 'this' keyword refer to in JavaScript?
a)
The current object
b)
The previous object
c)
The global object
d)
None of the above
89.
Which of these is a way to embed JavaScript into an HTML file?
a)
<script> tag
b)
<js> tag
c)
<javascript> tag
d)
<embed> tag
90.
Which of the following can JavaScript be used for?
a)
Form validation
b)
Creating dynamic content
c)
Making animations
d)
All of the above
91.
Which function is used to execute some code when a user clicks an element?
a)
onclick
b)
onhover
c)
onchange
d)
onpress
92.
What does the confirm() function do in JavaScript?
a)
Displays message with OK/Cancel
b)
Asks for user input
c)
Displays a single OK button
d)
None of the above
93.
Which loop is used to iterate through an array in JavaScript?
a)
for
b)
while
c)
foreach
d)
All of the above
94.
Which of the following keywords is used to exit a loop in JavaScript?
a)
exit
b)
stop
c)
break
d)
end
95.
Which of the following is a way to add JavaScript externally to an HTML file?
a)
<script href="file.js"></script>
b)
<script src="file.js"></script>
c)
<link src="file.js"></script>
d)
<js src="file.js"></script>
96.
JavaScript is used only on the client-side.
a)
True
b)
False
97.
JavaScript is an interpreted language.
a)
True
b)
False
98.
JavaScript does not support object-oriented programming.
a)
True
b)
False
99.
AJAX allows JavaScript to update parts of a web page without reloading.
a)
True
b)
False
100.
The DOM allows JavaScript to manipulate the structure of a web page.
a)
True
b)
False
100 %
