HTML Quiz
1. What does HTML stand for?
A. Hyper Text Markup Language Your answer
B. Hyperlinks and Text Markup Language
C. Home Tool Markup Language
2. Who is making the Web standards?
A. The World Wide Web Consortium Your answer
B. Microsoft
C. Mozilla
D. Google
3. Choose the correct HTML element for the largest heading:
A. <h1> Your answer
B. <h6>
C. <head>
D. <heading>
4. What is the correct HTML element for inserting a line break?
A. <br> Your answer
B. <lb>
C. <break>
5. What is the correct HTML for adding a background color?
A. <body style="background-color:yellow;"> Your answer
B. <background>yellow</background>
C. <body bg="yellow">
6. Choose the correct HTML element to define important text
A. <strong> Your answer
B. <b>
C. <i>
D. <important>
7. Choose the correct HTML element to define emphasized text
A. <em> Your answer
B. <i>
C. <italic>
8. What is the correct HTML for creating a hyperlink?
A. <a href="[Link] Your answer
B. <a url="[Link]
C. <a name="[Link]
D. <a>[Link]
9. Which character is used to indicate an end tag?
A. / Your answer
B. ^
C. <
D. *
10. How can you open a link in a new tab/browser window?
A. <a href="url" target="_blank"> Your answer
B. <a href="url" target="new">
C. <a href="url" new>
11. Which of these elements are all <table> elements?
A. <table><tr><td> Your answer
B. <table><tr><tt>
C. <thead><body><tr>
D. <table><head><tfoot>
12. Inline elements are normally displayed without starting a new line.
A. True Your answer
B. False
13. How can you make a numbered list?
A. <ol> Your answer
B. <ul>
C. <list>
D. <dl>
14. How can you make a bulleted list?
A. <ul> Your answer
B. <dl>
C. <list>
D. <ol>
15. What is the correct HTML for making a checkbox?
A. <input type="check"> Your answer
B. <check>
C. <input type="checkbox"> Correct answer
D. <checkbox>
16. What is the correct HTML for making a text input field?
A. <input type="text"> Your answer
B. <input type="textfield">
C. <textfield>
D. <textinput type="text">
17. What is the correct HTML for making a drop-down list?
A. <input type="dropdown"> Your answer
B. <input type="list">
C. <list>
D. <select> Correct answer
18. What is the correct HTML for making a text area?
A. <textarea> Your answer
B. <input type="textarea">
C. <input type="textbox">
19. What is the correct HTML for inserting an image?
A. <img src="[Link]" alt="MyImage"> Your answer
B. <img alt="MyImage">[Link]</img>
C. <image src="[Link]" alt="MyImage">
D. <img href="[Link]" alt="MyImage">
20. What is the correct HTML for inserting a background image?
A. <body style="background-image:url([Link])"> Your answer
B. <body bg="[Link]">
C. <background img="[Link]">
21. An <iframe> is used to display a web page within a web page.
1. True Your answer
2. False
3. There is no such thing as an <iframe>
22. HTML comments start with <!-- and end with -->
1. True Your answer
2. False
23. Block elements are normally displayed without starting a new line.
1. False Your answer
2. True
24. Which HTML element defines the title of a document?
1. <title> Your answer
2. <meta>
3. <head>
25. Which HTML attribute specifies an alternate text for an image, if the image
cannot be displayed?
A. alt Your answer
B. title
C. longdesc
D. src
26. Which doctype is correct for HTML5?
A. <!DOCTYPE html> Your answer
B. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN"
"[Link]
C. <!DOCTYPE HTML5>
27. Which HTML element is used to specify a footer for a document or section?
A. <footer> Your answer
B. <section>
C. <bottom>
28. In HTML, you can embed SVG elements directly into an HTML page.
A. True Your answer
B. False
29. What is the correct HTML element for playing video files?
A. <video> Your answer
B. <media>
C. <movie>
30. What is the correct HTML element for playing audio files?
A. <audio> Your answer
B. <sound>
C. <mp3>
31. The HTML global attribute, "contenteditable" is used to:
A. Specify whether the content of an element should be editable or not Your
answer
B. Return the position of the first found occurrence of content inside a string
C. Specifies a context menu for an element. The menu appears when a user
right-clicks on the element
D. Update content from the server
32. In HTML, onblur and onfocus are:
A. Event attributes Your answer
B. HTML elements
C. Style attributes
33. Graphics defined by SVG is in which format?
A. XML Your answer
B. HTML
C. CSS
34. The HTML <canvas> element is used to:
A. draw graphics Your answer
B. create draggable elements
C. manipulate data in MySQL
D. display database records
35. In HTML, which attribute is used to specify that an input field must be filled
out?
A. required Your answer
B. formvalidate
C. validate
D. placeholder
36. Which input type defines a slider control?
A. range Your answer
B. controls
C. slider
D. search
37. Which HTML element is used to display a scalar measurement within a
range?
A. <range> Your answer
B. <measure>
C. <gauge>
D. <meter> Correct answer
38. Which HTML element defines navigation links?
A. <nav> Your answer
B. <navigate>
C. <navigation>
39. In HTML, what does the <aside> element define?
A. Content aside from the page content Your answer
B. The ASCII character-set; to send information between computers on the
Internet
C. A navigation list to be shown at the left side of the page
40. Which HTML element is used to specify a header for a document or section?
A. <header> Your answer
B. <section>
C. <head>
D. <top>
CSS Quiz
1. What does CSS stand for?
A. Cascading Style Sheets Your answer
B. Colorful Style Sheets
C. Creative Style Sheets
D. Computer Style Sheets
2. What is the correct HTML for referring to an external style sheet?
A. <link rel="stylesheet" type="text/css" href="[Link]"> Your answer
B. <style src="[Link]">
C. <stylesheet>[Link]</stylesheet>
3. Where in an HTML document is the correct place to refer to an external style
sheet?
A. In the <head> section Your answer
B. At the end of the document
C. In the <body> section
4. Which HTML tag is used to define an internal style sheet?
A. <style> Your answer
B. <script>
C. <css>
5. Which HTML attribute is used to define inline styles?
A. style Your answer
B. class
C. styles
D. font
6. Which is the correct CSS syntax?
A. body {color: black;} Your answer
B. body:color=black;
C. {body;color:black;}
D. {body:color=black;}
7. How do you insert a comment in a CSS file?
A. /* this is a comment */ Your answer
B. // this is a comment
C. ' this is a comment
D. // this is a comment //
8. Which property is used to change the background color?
A. background-color Your answer
B. bgcolor
C. color
9. How do you add a background color for all <h1> elements?
A. h1 {background-color:#FFFFFF;} Your answer
B. [Link] {background-color:#FFFFFF;}
C. all.h1 {background-color:#FFFFFF;}
10. Which CSS property is used to change the text color of an element?
A. color Your answer
B. fgcolor
C. text-color
11. Which CSS property controls the text size?
A. font-size Your answer
B. font-style
C. text-size
D. text-style
12. What is the correct CSS syntax for making all the <p> elements bold?
A. p {font-weight:bold;} Your answer
B. <p style="font-size:bold;">
C. <p style="text-size:bold;">
D. p {text-size:bold;}
13. How do you display hyperlinks without an underline?
A. a {text-decoration:none;} Your answer
B. a {text-decoration:no-underline;}
C. a {underline:none;}
D. a {decoration:no-underline;}
14. How do you make each word in a text start with a capital letter?
A. text-transform:capitalize Your answer
B. transform:capitalize
C. text-style:capitalize
D. You can't do that with CSS
15. Which property is used to change the font of an element?
A. font-family Your answer
B. font-style
C. font-weight
16. How do you make the text bold?
A. font-weight:bold; Your answer
B. font:bold;
C. style:bold;
17. How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1pixel?
A. border-width:10px 1px 5px 20px; Your answer
B. border-width:10px 5px 20px 1px;
C. border-width:5px 20px 10px 1px;
D. border-width:10px 20px 5px 1px;
18. Which property is used to change the left margin of an element?
A. margin-left Your answer
B. padding-left
C. indent
19. When using the padding property; are you allowed to use negative values?
A. No Your answer
B. Yes
20. How do you make a list that lists its items with squares?
A. list-style-type: square; Your answer
B. list: square;
C. list-type: square;
21. How do you select an element with id 'demo'?
A. #demo Your answer
B. demo
C. *demo
D. .demo
22. How do you select elements with class name 'test'?
A. .test Your answer
B. #test
C. *test
D. test
23. How do you select all p elements inside a div element?
A. div p Your answer
B. div.p
C. div + p
24. How do you group selectors?
A. Separate each selector with a comma Your answer
B. Separate each selector with a space
C. Separate each selector with a plus sign
25. What is the default value of the position property?
A. absolute Your answer
B. relative
C. static Correct answer
D. fixed
JavaScript Quiz
1. Inside which HTML element do we put the JavaScript?
A. <script> Your answer
B. <javascript>
C. <scripting>
D. <js>
2. What is the correct JavaScript syntax to change the content of the HTML
element below?
<p id="demo">This is a demonstration.</p>
A. [Link]("demo").innerHTML = "Hello World!"; Your
answer
B. #[Link] = "Hello World!";
C. [Link]("p").innerHTML = "Hello World!";
D. [Link]("p").innerHTML = "Hello World!";
3. Where is the correct place to insert a JavaScript?
A. Both the <head> section and the <body> section are correct Your answer
B. The <body> section
C. The <head> section
4. What is the correct syntax for referring to an external script called "[Link]"?
A. <script src="[Link]">
B. <script href="[Link]">
C. <script name="[Link]">
5. The external JavaScript file must contain the <script> tag.
A. True
B. False
6. How do you write "Hello World" in an alert box?
A. alert("Hello World"); Your answer
B. msg("Hello World");
C. msgBox("Hello World");
D. alertBox("Hello World");
7. How do you create a function in JavaScript?
A. function myFunction() Your answer
B. function = myFunction()
C. function:myFunction()
8. How do you call a function named "myFunction"?
A. myFunction() Your answer
B. call function myFunction()
C. call myFunction()
9. How to write an IF statement in JavaScript?
A. if i == 5 then
B. if i = 5 then
C. if (i == 5) Correct answer
D. if i = 5
10. How to write an IF statement for executing some code if "i" is NOT equal to
5?
A. if i =! 5 then Your answer
B. if i <> 5
C. if (i != 5) Correct answer
D. if (i <> 5)
11. How does a WHILE loop start?
A. while (i <= 10; i++) Your answer
B. while (i <= 10) Correct answer
C. while i = 1 to 10
12. How does a FOR loop start?
A. for (i = 0; i <= 5) Your answer
B. for (i <= 5; i++)
C. for i = 1 to 5
D. for (i = 0; i <= 5; i++) Correct answer
13. How can you add a comment in a JavaScript?
A. //This is a comment Your answer
B. <!--This is a comment-->
C. 'This is a comment
14. How to insert a comment that has more than one line?
A. //This comment has
more than one line// Your answer
B. /*This comment has
more than one line*/ Correct answer
C. <!--This comment has
more than one line-->
15. What is the correct way to write a JavaScript array?
A. var colors = (1:"red", 2:"green", 3:"blue") Your answer
B. var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
C. var colors = "red", "green", "blue"
D. var colors = ["red", "green", "blue"] Correct answer
16. How do you round the number 7.25, to the nearest integer?
A. [Link](7.25) Your answer
B. [Link](7.25)
C. rnd(7.25)
D. round(7.25)
17. How do you find the number with the highest value of x and y?
A. top(x, y) Your answer
B. [Link](x, y) Correct answer
C. ceil(x, y)
D. [Link](x, y)
18. What is the correct JavaScript syntax for opening a new window called
"w2"?
A. w2 = [Link]("[Link] Your answer
B. w2 = [Link]("[Link] Correct answer
19. JavaScript is the same as Java.
A. False Your answer
B. True
20. How can you detect the client's browser name?
A. [Link] Your answer
B. [Link] Correct answer
C. [Link]
21. Which event occurs when the user clicks on an HTML element?
A. onclick Your answer
B. onchange
C. onmouseover
D. onmouseclick
22. How do you declare a JavaScript variable?
A. var carName; Your answer
B. v carName;
C. variable carName;
23. Which operator is used to assign a value to a variable?
A. = Your answer
B. x
C. -
D. *
24. What will the following code return: Boolean(10 > 9)
A. false Your answer
B. NaN
C. true Correct answer
25. Is JavaScript case-sensitive?
A. No
B. Yes Correct answer
PHP Quiz
1. What does PHP stand for?
A. PHP: Hypertext Preprocessor Your answer
B. Personal Hypertext Processor
C. Private Home Page
2. PHP server scripts are surrounded by delimiters, which?
A. <?php...?> Your answer
B. <&>...</&>
C. <script>...</script>
D. <?php>...</?>
3. How do you write "Hello World" in PHP?
A. echo "Hello World"; Your answer
B. "Hello World";
C. [Link]("Hello World");
4. All variables in PHP start with which symbol?
A. $ Your answer
B. !
C. &
5. What is the correct way to end a PHP statement?
A. New line Your answer
B. </php>
C. .
D. ; Correct answer
6. The PHP syntax is most similar to:
A. Perl and C Your answer
B. VBScript
C. JavaScript
7. How do you get information from a form that is submitted using the "get"
method?
A. $_GET[]; Your answer
B. [Link];
C. [Link];
8. When using the POST method, variables are displayed in the URL:
A. False Your answer
B. True
9. In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
A. True Your answer
B. False
10. Include files must have the file extension ".inc"
A. True
B. False Correct answer
11. What is the correct way to include the file "[Link]"?
A. <?php include "[Link]"; ?> Your answer
B. <!-- include file="[Link]" -->
C. <?php include:"[Link]"; ?>
D. <?php include file="[Link]"; ?>
12. What is the correct way to create a function in PHP?
A. function myFunction() Your answer
B. new_function myFunction()
C. create myFunction()
13. What is the correct way to open the file "[Link]" as readable?
A. open("[Link]","read"); Your answer
B. fopen("[Link]","r"); Correct answer
C. open("[Link]");
D. fopen("[Link]","r+");
14. PHP allows you to send emails directly from a script
A. True Your answer
B. False
15. Which superglobal variable holds information about headers, paths, and
script locations?
A. $_SESSION Your answer
B. $_SERVER Correct answer
C. $GLOBALS
D. $_GET
16. What is the correct way to add 1 to the $count variable?
A. $count =+1 Your answer
B. count++;
C. ++count
D. $count++; Correct answer
17. What is a correct way to add a comment in PHP?
A. /*...*/ Your answer
B. <!--...-->
C. *\...\*
D. <comment>...</comment>
18. PHP can be run on Microsoft Windows IIS(Internet Information Server):
A. True Your answer
B. False
19. The die() and exit() functions do the exact same thing.
A. False
B. True Correct answer
20. Which one of these variables has an illegal name?
A. $myVar Your answer
B. $my_Var
C. $my-Var Correct answer
21. How do you create a cookie in PHP?
A. setcookie() Your answer
B. createcookie
C. makecookie()
22. In PHP, the only way to output text is with echo.
A. False Your answer
B. True
23. How do you create an array in PHP?
A. $cars = array("Volvo", "BMW", "Toyota"); Your answer
B. $cars = "Volvo", "BMW", "Toyota";
C. $cars = array["Volvo", "BMW", "Toyota"];
24. The if statement is used to execute some code only if a specified condition is
true
A. True Your answer
B. False
25. Which operator is used to check if two values are equal and of same data
type?
A. ==
B. === Correct answer
C. !=
D. =
Bootstrap 5 Quiz
Question 1:
The .container class provides a full width container, spanning the entire width of
the screen
A. False Your answer
B. True
Question 2:
Which class provides a responsive fixed width container?
A. .container Your answer
B. .container-responsive
C. .container-fluid
D. .container-fixed
Question 3:
Which contextual class is used to create an orange text color?
A. .text-warning Your answer
B. .bg-warning
C. .txt-orange
D. .txt-warning
Question 4:
The Bootstrap grid system is based on how many columns?
A. 12 Your answer
B. 9
C. 6
D. 3
Question 5:
Which class adds zebra-stripes to a table?
A. .table-striped Your answer
B. .table-zebra
C. .even and .odd
D. .table-bordered
Question 6:
Which class shapes an image to a circle?
A. .rounded-circle Your answer
B. .img-rounded
C. .img-circle
D. .img-round
Question 7:
Which class is used to create a big box for calling extra attention?
A. .bigbox
B. .jumbotron
C. .container
D. There is no such class Correct answer
Question 8:
Which class is used to create a button group?
A. .btn-group Your answer
B. .button-group
C. .group-button
D. .group-btn
Question 9:
Which button class is used to create a large button?
A. .btn-lg Your answer
B. .btn-l
C. .btn-large
D. .btn-l2
Question 10:
Which class is used to create a badge?
A. .badge Your answer
B. .label-badge
C. .badge-label
D. .badge-item
Question 11:
Which class is used to create a loader?
A. .loader
B. .spinner-border Correct answer
C. .spinner
D. .spinner-loader
Question 12:
Which class is used to create a basic pagination?
A. .pagination Your answer
B. .pages
C. .navigation
D. .page
Question 13:
Which class is used to create a basic list group?
A. .list-group Your answer
B. .grouped-list
C. .group-list
Question 14:
Which class adds a heading to a card?
A. .card-head
B. .card-heading
C. .card-footer
D. .card-header Correct answer
Question 15:
Which class indicates a dropdown menu?
A. .dropdown Your answer
B. .select
C. .dropdown-list
Question 16:
Which class is used to create a vertical navigation bar?
A. .navbar Your answer
B. .navbar navbar-vertical
C. .navbar-vertical
D. .navbar-inverse
Question 17:
Which component is used to cycle through elements, like a slideshow?
A. Carousel Your answer
B. Scrollspy
C. Orbit
D. Slideshow
Question 18:
Which contextual class indicates a succesful or positive action?
A. .bg-success Your answer
B. .bg-info
C. .bg-warning
D. .bg-primary
Question 19:
Which contextual class indicates a dangerous or potentially negative action?
A. .bg-danger Your answer
B. .bg-info
C. .bg-dark
D. .bg-primary
Question 20:
Which class indicates uppercased text?
A. .text-uppercase Your answer
B. .ucase
C. .text-capitalize
D. .uppercase
Question 21:
Which attribute is used to create a tooltip?
A. data-bs-toggle="tooltip" Your answer
B. data-bs-toggle="modal"
C. data-bs-toggle="popup"
D. data-bs-toggle="collapse"
Question 22:
A standard navigation tab is created with:
A. <ul class="nav nav-navbar"> Your answer
B. <ul class="navigation-tabs">
C. <ul class="nav tabs">
D. <ul class="nav nav-tabs"> Correct answer
Question 23:
A standard navigation bar is created with:
A. <nav class="navbar navbar-default"> Your answer
B. <nav class="nav navbar">
C. <nav class="navigationbar navbar-default">
D. <nav class="navbar navbar-expand-sm"> Correct answer
Question 24:
Which class is used to style a close icon?
A. .close-icon Your answer
B. .btn-x
C. .btn-close Correct answer
D. .x
Question 25:
Which class can be used to float an element to the right of the page?
A. .float-right Your answer
B. .float-end Correct answer
C. .float-start
D. .float-r