NEW
Font size
WorksheetsLevel 1
Total questions: 80
Worksheet time: 27mins
What is the primary function of the internet?
To store data permanently
To provide a network for communication and data exchange
To create software applications
To design websites
What is a web browser?
A type of server
Software for accessing websites
A type of internet connection
A programming language
Which of the following is NOT a component of a website?
Web pages
Links
Email accounts
Images
Which of these roles is responsible for designing the layout and appearance of a website?
Web Developer
Web Designer
Database Administrator
Network Engineer
What does HTML stand for?
HyperText Markup Language
HyperTransfer Media Language
HyperText Multilayer Language
Hyperlink Text Markup Language
What is the purpose of the
tag in an HTML document?To define the main content of the page
To provide metadata and links to scripts and styles
To display images
To create hyperlinks
What is the purpose of the src attribute in the tag?
To specify the image source file
To set the image size
To add a title to the image
To specify the image alt text
Which attribute specifies how form data is sent to the server?
action
method
name
type
Which input type would you use for a password field?
text
password
hidden
What does the
The navigation bar
The main content section
The bottom section of a page or section
The top section of a page
What is the purpose of the alt attribute in an tag?
To specify the image source
To provide alternative text for screen readers
To define the image size
To add a link to the image
What does CSS stand for?
Cascading Style Sheets
Creative Style Sheets
Custom Style Syntax
Cascading Script Sheets
Which CSS selector targets elements by their class name?
#classname
.classname
classname
*classname
What is the purpose of selector in CSS?
To define the HTML structure
To specify which HTML elements to style
To create web forms
To link JavaScript functions
How can you apply CSS styles to multiple elements using a class selector?
.classname { property: value; }
#classname { property: value; }
classname { property: value; }
element.classname { property: value; }
What does the CSS box-sizing property do?
It sets the dimensions of an element including padding and border
It adjusts the border style of an element
It changes the font size of text inside an element
It controls the visibility of an element
Which property defines the space between an element's content and its border?
margin
padding
border
content
What is the default value of the position property in CSS?
absolute
relative
fixed
static
How do you center an element horizontally using CSS?
margin: 0 auto;
text-align: center;
align-items: center;
display: block; margin: 0 auto;
What is Flexbox primarily used for in CSS?
Grid layout
Responsive design
Aligning and distributing space among items in a container
Typography
What does the display: flex; property do?
It defines the element as a flex container
It makes the element fixed in position
It sets the element to grid layout
It makes the element invisible
Which property controls the alignment of flex items along the main axis?
align-items
justify-content
flex-direction
align-content
What is the purpose of the float property in CSS?
To position an element relative to its normal position
To make an element float above other elements
To wrap text around an element
To center an element horizontally
What does position: absolute; do to an element?
It positions the element relative to its nearest positioned ancestor
It positions the element relative to the viewport
It positions the element at the top of the page
It positions the element relative to the document flow
Which property specifies the number of columns in a CSS Grid?
grid-template-rows
grid-template-columns
grid-area
grid-gap
What is the main goal of responsive web design?
To optimize web pages for different screen sizes and devices
To create static web pages
To improve page loading speed
To integrate multimedia content
Which CSS feature is commonly used to apply different styles for different screen sizes?
Media queries
Pseudo-classes
Flexbox
Grid layout
What unit would you use to create a layout that scales with the viewport width?
px
em
vw
pt
Which of the following is a correct media query syntax to apply styles for screens wider than 600px?
@media screen and (min-width: 600px) { ... }
@media (width > 600px) { ... }
@media (min-width: 600px) { ... }
@media (screen: 600px) { ... }
What does vh stand for in responsive design?
Viewport height
Viewport width
Vertical height
Vertical width
Who created JavaScript?
Brendan Eich
Tim Berners-Lee
Mark Zuckerberg
James Gosling
Which version of ECMAScript introduced arrow functions?
ES5
ES6
ES7
ES8
Which of the following is NOT a data type in JavaScript?
String
Number
Boolean
Integer
What does the let keyword do in JavaScript?
Declares a variable with block scope
Declares a variable with function scope
Declares a constant
Declares a global variable
What is the result of 3 + '3' in JavaScript?
6
33
NaN
33
Which statement is used to perform different actions based on conditions in JavaScript?
switch
for
while
function
What is the purpose of the break statement in a loop?
To exit the loop
To skip the current iteration
To restart the loop
To pause the loop
Which function declaration is correct in JavaScript?
function myFunc() { ... }
func myFunc() { ... }
myFunc() function { ... }
function: myFunc() { ... }
What does the return keyword do in a function?
Exits the function and optionally returns a value
Calls the function
Defines the function
Sets a default value for parameters
How do you create a for loop in JavaScript?
for (initialization; condition; increment) { ... }
loop (initialization; condition; increment) { ... }
while (condition) { ... }
repeat (initialization; condition; increment) { ... }
What does the DOM represent?
The Document Object Model
The Data Output Module
The Dynamic Object Model
The Document Order Method
Which method selects an element by its ID?
getElementById()
querySelector()
getElementsByClassName()
querySelectorAll()
What is the purpose of the
element in an HTML document?To contain metadata and links to scripts and stylesheets
To display the main content of the page
To create a footer for the page
To define the navigation menu
Which HTML tag is used to create a hyperlink?
<link>
<a>
<href>
<url>
What does the z-index property control in CSS?
The stacking order of elements
The size of an element
The visibility of an element
The spacing between elements
Which of the following is a valid HTML5 doctype declaration?
DOCTYPE html
!DOCTYPE html5
HTML5 doctype
!DOCTYPE HTML
Which HTML element is used to define the footer of a document or section?
<footer>
<bottom>
<section>
<div>
Which of the following is a method to convert a string to a number in JavaScript?
parseInt()
toNumber()
convert()
stringToNumber()
What does the CSS display property control?
The visibility of an element
The layout behavior of an element
The color of an element
The size of an element
Which HTML element is used to define an unordered list?
<ol>
<ul>
<list>
<li>
Which of the following is a valid way to declare a constant in JavaScript?
const myConst = 10;
constant myConst = 10;
let myConst = 10;
var myConst = 10;
Which CSS property is used to change the text color of an element?
color
background-color
font-color
text-color
What will the following code output: console.log(typeof NaN);?
number
undefined
NaN
object
What is the purpose of the
To create a form for user input
To define the structure of a webpage
To link external stylesheets
To embed multimedia content
What is the default value of the display property in CSS?
block
inline
none
flex
Which CSS property is used to control the layout of items in a CSS Grid container?
grid-template-columns
grid-template-areas
grid-column
grid-row
Which responsive design technique adjusts the layout based on the viewport height?
Viewport units
Flexbox
Media queries
Grid layout
What is the purpose of the position: sticky; property in CSS?
It allows an element to stick to the top of the viewport when scrolling
It positions an element relative to its normal position
It makes an element fixed in place regardless of scrolling
It floats an element to the left or right of its container
Which of the following units is relative to the font size of the element?
px
pt
em
cm
What is the main difference between CSS Grid and Flexbox?
CSS Grid is one-dimensional, while Flexbox is two-dimensional
CSS Grid is two-dimensional, while Flexbox is one-dimensional
CSS Grid is used for positioning elements, while Flexbox is used for layout
CSS Grid is only for responsive design, while Flexbox is not
What property is used to align flex items along the main axis in a flex container?
align-items
justify-content
flex-direction
flex-wrap
Which value of the flex-direction property arranges flex items in a column?
row
column
row-reverse
column-reverse
What does the flex-grow property do in a flex container?
Defines the ability for a flex item to grow relative to the rest
Sets the initial size of a flex item
Controls the order of flex items
Defines the space between flex items
What is the purpose of the clear property in CSS?
To specify how elements should behave when they are floated
To set the visibility of an element
To define the stacking order of elements
To adjust the margin of an element
Which of the following values can be used with the float property?
left
right
none
All of the above
What happens to a floated element in CSS?
It is removed from the normal document flow
It becomes fixed in position
It is displayed as a block element
It is hidden from view
What does the CSS box model consist of?
Content, padding, border, margin
Content, padding, border, outline
Content, margin, outline, shadow
Content, padding, margin, shadow
How does the margin property affect the layout of an element?
It adds space inside the element
It adds space outside the element
It changes the background color of the element
It adjusts the font size of the element
Which property would you use to create space between the border and the content of an element?
margin
padding
border-spacing
gap
What input type would you use for a checkbox in a form?
text
checkbox
radio
button
What is the output of the following code: for(let i = 0; i < 5; i++) { console.log(i); }?
0 1 2 3 4
1 2 3 4 5
0 1 2 3 4 5
5
Which loop will always execute at least once?
for loop
while loop
do...while loop
foreach loop
What does the term 'media query' refer to in CSS?
A method to apply styles based on device characteristics
A way to query the server for data
A function to manipulate media files
A type of CSS selector
What is the purpose of the 'if' statement in programming?
To define a function
To execute a block of code based on a condition
To create a loop
To declare a variable
Which of the following correctly represents a switch statement in JavaScript?
switch (expression) { case value: ... }
switch { case value: ... }
switch (value) { ... }
case (value) switch { ... }
What will be the output of the following code: let x = 10; if (x > 5) { console.log('Greater'); } else { console.log('Smaller'); }?
Greater
Smaller
undefined
Error
What HTML tag is used to create a table?
<table>
<tab>
<tbody>
<tr>
Which attribute is used to specify the width of a table in HTML?
width
size
table-width
colspan
Which HTML element is used to define a section in a web page?
<div>
<article>
<section>
<container>
What will the following JavaScript code output?
console.log('5' - 3);
"5 - 3"
2
NaN
"53"
