Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views16 pages

Web Question Bank

Uploaded by

jogigg9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views16 pages

Web Question Bank

Uploaded by

jogigg9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

· Which of the following is a correct XHTML document structure?

· a) <html><head><title></title></head><body></body></html>
b) <html><head><body><title></body></head></html>
c) <html><head><body></body><title></head></html>
d) <html><body><head><title></title></head></body></html>
Answer: a) <html><head><title></title></head><body></body></html>
· Which HTML element is used to insert an image?
· a) <image>
b) <img>
c) <picture>
d) <src>
Answer: b) <img>
· What does the <ul> tag define in HTML?
· a) An ordered list
b) An unordered list
c) A table
d) A paragraph
Answer: b) An unordered list
· Which of the following is used to create a table in HTML?
· a) <table>
b) <row>
c) <list>
d) <div>
Answer: a) <table>
· Which attribute is used to specify the destination of a hyperlink?
· a) href
b) src
c) target
d) action
Answer: a) href
· What is the main difference between HTML and XHTML?
· a) XHTML requires stricter syntax rules
b) HTML is older than XHTML
c) XHTML cannot include images
d) XHTML does not support hyperlinks
Answer: a) XHTML requires stricter syntax rules
· What does the <form> tag do in HTML?
· a) It creates a form for user input
b) It formats text
c) It inserts an image
d) It inserts a link
Answer: a) It creates a form for user input
· Which tag is used to define a table row in HTML?
· a) <td>
b) <tr>
c) <th>
d) <table>
Answer: b) <tr>
· In XHTML, what must all tags have?
· a) Unique identifiers
b) Closing tags
c) A style attribute
d) A <head> section
Answer: b) Closing tags
· Which attribute is used to set the width of an image in HTML?
· a) width
b) size
c) imgwidth
d) length
Answer: a) width

· What does WWW stand for?


a) World Wide Web
b) Web World Web
c) World Web Web
d) Web Wide World
Answer: a) World Wide Web
· · Which of the following is the primary purpose of the Internet?
a) To store data
b) To allow communication between computers
c) To provide social media access
d) To create web pages
Answer: b) To allow communication between computers
· · Which of these is not a function of a web browser?
a) Rendering HTML content
b) Sending requests to web servers
c) Storing website data on the server
d) Displaying images and videos
Answer: c) Storing website data on the server
· · Which protocol is used for transferring web pages over the Internet?
a) FTP
b) HTTP
c) SMTP
d) POP3
Answer: b) HTTP
· · Which of the following is the correct syntax for a URL?
a) www.website.com
b) https://www.website.com
c) ftp://www.website.com
d) http://website
Answer: b) https://www.website.com
· · What is MIME used for in web programming?
a) To create web pages
b) To encode files for storage
c) To specify the types of files being sent over the Internet
d) To format URLs
Answer: c) To specify the types of files being sent over the Internet
· · Which of these is a method used by HTTP for request and response communication?
a) GET
b) POST
c) PUT
d) All of the above
Answer: d) All of the above
· · Which of these is an example of a web server?
a) Chrome
b) Apache
c) Windows 10
d) Linux
Answer: b) Apache
· · What is the main difference between HTML and XHTML?
a) XHTML is more complex than HTML
b) XHTML is stricter in terms of syntax and requires proper nesting of tags
c) HTML uses more tags than XHTML
d) XHTML cannot use CSS
Answer: b) XHTML is stricter in terms of syntax and requires proper nesting of tags
· · Which of the following is not a web browser?
a) Google Chrome
b) Mozilla Firefox
c) Safari
d) Windows Explorer
Answer: d) Windows Explorer
·
CSS stands for:

a) Creative Style Sheets


b) Cascading Style Sheets
c) Computer Style Sheets
d) Colorful Style Sheets
Answer: b) Cascading Style Sheets

What is the primary purpose of CSS?

a) Adding interactive elements


b) Structuring web page content
c) Styling and formatting web pages
d) Executing server-side scripts
Answer: c) Styling and formatting web pages

What are the three types of CSS?

a) Inline, External, Internal


b) Inline, Embedded, External
c) Embedded, Static, Linked
d) Linked, Internal, Global
Answer: b) Inline, Embedded, External

Which tag is used to apply an external CSS file?

a) <script>
b) <link>
c) <style>
d) <css>
Answer: b) <link>

What is the correct syntax for an inline CSS style?

a) <tag style="property:value;">
b) <tag css="property:value;">
c) <tag link="property:value;">
d) <tag format="property:value;">
Answer: a) <tag style="property:value;">

2. Levels of Style Sheets

Which CSS level applies styles directly to a specific tag in an HTML document?

a) Inline
b) Internal
c) External
d) Universal
Answer: a) Inline

Where is an internal CSS style written?

a) Inside a <link> tag


b) Inside a <style> tag in the <head> section
c) Within a specific HTML element
d) In an external .css file
Answer: b) Inside a <style> tag in the <head> section

How is an external CSS file linked to an HTML document?

a) <script src="style.css">
b) <link href="style.css">
c) <link rel="stylesheet" href="style.css">
d) <style href="style.css">
Answer: c) <link rel="stylesheet" href="style.css">

Which type of CSS takes the highest precedence?

a) Inline CSS
b) External CSS
c) Internal CSS
d) Browser Default CSS
Answer: a) Inline CSS

What is the advantage of using external CSS?

a) Easy to apply styles to multiple pages


b) No need for <style> tags
c) Faster page load times
d) Inline overrides external styles
Answer: a) Easy to apply styles to multiple pages

3. Selector Forms

Which selector is used to target all elements on a webpage?

a) Universal (*)
b) ID Selector
c) Class Selector
d) Element Selector
Answer: a) Universal (*)

What does a class selector start with?

a) .
b) #
c) @
d) :
Answer: a) .

What does an ID selector start with?

a) .
b) #
c) @
d) :
Answer: b) #

How do you apply a style to all <p> elements on a page?

a) p {property:value;}
b) * {property:value;}
c) .p {property:value;}
d) #p {property:value;}
Answer: a) p {property:value;}

What is the purpose of a pseudo-class in CSS?

a) To define different states of an element


b) To select multiple elements
c) To create animations
d) To override inline styles
Answer: a) To define different states of an element

4. Property Value Forms

Which of these is a valid CSS property?

a) font-style
b) font-size
c) font-family
d) All of the above
Answer: d) All of the above

What is the default value of the position property in CSS?

a) static
b) relative
c) absolute
d) fixed
Answer: a) static

What property is used to set the background color of an element?

a) color
b) bgcolor
c) background-color
d) background
Answer: c) background-color

How is padding different from margin in CSS?

a) Padding is inside the border; margin is outside the border.


b) Padding is outside the border; margin is inside the border.
c) Both are the same.
d) None of the above.
Answer: a) Padding is inside the border; margin is outside the border.

Which property specifies the space between text characters?

a) word-spacing
b) letter-spacing
c) line-spacing
d) text-indent
Answer: b) letter-spacing

What does "WWW" stand for?

A) World Wide Web


B) World Web Wide
C) Web World Wide
D) Web Wide World
Ans-A

Which protocol is primarily used to transfer web pages over the Internet?

A) FTP
B) HTTPS
C) HTTP
D) SMTP
Ans- C

Which of the following is a popular web browser?

A) Adobe
B) Chrome
C) Windows
D) Linux
Ans-B

What does URL stand for?

A) Universal Resource Link


B) Uniform Resource Locator
C) Uniform Resource Link
D) Universal Resource Locator
Ans- D

Which tag is used to add comments in HTML?

A) <comment>
B) <!-- -->
C) <notes>
D) <cmnt>
Ans- B

The <p> tag in HTML is used to create:

A) Paragraphs
B) Headings
C) Lists
D) Links
Ans- A

HTML files are typically saved with which file extension?

A) .htm or .html
B) .txt
C) .doc
D) .xml
Ans- A

The <h1> tag represents which heading level?

A) Smallest
B) Middle
C) Largest
D) Unordered
Ans- C

What does MIME stand for?

A) Multi Internet Mail Extensions


B) Multi-purpose Internet Mail Extensions
C) Mail Internet Multimedia Extensions
D) Multi-purpose Interactive Media Extensions
Ans- B

Which HTML tag is used to display an image?

A) <img>
B) <pic>
C) <image>
D) <src>
Ans- A

The src attribute in the <img> tag is used to specify:

A) Image alignment
B) Image source
C) Image size
D) Image type
Ans- B

Which HTML tag is used to embed video content?

A) <video>
B) <vid>
C) <movie>
D) <media>
Ans- A

What does XHTML stand for?

A) Extended HyperText Markup Language


B) Extensible HyperText Markup Language
C) Extra HyperText Markup Language
D) External HyperText Markup Language
Ans- B

Which attribute in the <a> tag is used to specify the destination URL?

A) href
B) src
C) link
D) dest
Ans- A

To open a link in a new tab, which attribute is used with the <a> tag?

A) src
B) target="_blank"
C) target="_self"
D) href="_blank"
Ans- B

What does HTTP stand for?

A) HyperText Transmission Protocol


B) Hyperlink Text Transfer Protocol
C) HyperText Transfer Protocol
D) Hyper Transfer Text Protocol
Ans- C

What does CSS stand for?

a) Color Styling Sheets


b) Cascading Style Sheets
c) Computer Styling Sheets
d) Creative Style Sheets
Answer: b) Cascading Style Sheets

Which CSS property is used to set the background color of an element?

a) background-color
b) color
c) bgcolor
d) background
Answer: a) background-color

Which of the following is a valid CSS selector?

a) .classname
b) #idname
c) elementname
d) All of the above
Answer: d) All of the above

What does the ‘font-size’ property in CSS control?

a) The size of the font


b) The color of the font
c) The style of the font
d) The background of the text
Answer: a) The size of the font

Which of the following is the correct CSS syntax to change the font color to red?

a) color: red;
b) font-color: red;
c) text-color: red;
d) font: color red;
Answer: a) color: red;

What is the purpose of the 'float' property in CSS?

a) It sets the visibility of an element


b) It changes the element’s position relative to the text
c) It adds a border around an element
d) It sets the font size
Answer: b) It changes the element’s position relative to the text

Which of the following defines the margin in CSS?

a) Space inside the element


b) Space outside the element
c) Border around the element
d) Padding around the text
Answer: b) Space outside the element

Which CSS property is used to align text to the center?

a) text-align: center;
b) text-align: middle;
c) align-text: center;
d) center-align: true;
Answer: a) text-align: center;

Which CSS property is used to define the width of an element?

a) width
b) size
c) length
d) height
Answer: a) width

Which of the following is a shorthand CSS property for setting both padding and margin?

a) margin-padding
b) padding-margin
c) margin
d) margin-top
Answer: c) margin

Advanced CSS Concepts

Which CSS property is used to change the font family of text?

a) font-family
b) font-type
c) text-family
d) font-style
Answer: a) font-family

How do you specify a class selector in CSS?

a) .classname
b) #classname
c) classname
d) &classname
Answer: a) .classname

What is the default value of the ‘display’ property in CSS?

a) block
b) inline
c) none
d) flex
Answer: b) inline

Which attribute is used with the <img> tag to specify alternate text for an image?

A) alt
B) src
C) href
D) align
Ans- A

Which tag is used to play audio files in HTML?

A) <audio>
B) <sound>
C) <music>
D) <mp3>
Ans - A
What does HTTPS provide that HTTP does not?

A) Speed
B) Security
C) Media files
D) Compatibility
Ans- B

In XHTML, all tags must be written in:

A) Uppercase only
B) Lowercase only
C) Mixed case
D) It doesn’t matter
Ans - B

The controls attribute in the <audio> tag is used to:

A) Control volume only


B) Provide playback controls for the user
C) Auto start the audio
D) Control video speed
Ans- B

MIME types are used to:

A) Identify the protocol


B) Indicate the format of a file
C) Set website permissions
D) Show HTML tags
Ans - B

In HTML, the title attribute can be added to:

A) Only images
B) Any HTML element
C) Only paragraphs
D) Only hyperlinks
Ans - B

Which of the following is a security risk on the web?

A) HTTP
B) HTTPS
C) URL
D) MIME
Ans- A

Which tag is used to create an ordered list in HTML?

A) <ul>
B) <ol>
C) <li>
D) <dl>
Ans- B

The <ul> tag in HTML is used to create:

A) Unordered lists
B) Ordered lists
C) Descriptive lists
D) Inline lists
Ans - A

Which attribute is used with <ol> to change the numbering style?

A) style
B) type
C) class
D) id
Ans- type

What does the <li> tag represent in an HTML list?

A) List header
B) List item
C) List type
D) List description
Ans - B

The <form> tag in HTML is used for:

A) Formatting content
B) Embedding images
C) Collecting user input
D) Displaying tables
Ans - C

Which attribute specifies the URL where form data is sent?

A) method
B) action
C) target
D) src
Ans - B

What does the <hr> tag represent in HTML?

A) A line break
B) A horizontal rule
C) A paragraph break
D) A bold line
Ans - B

Which tag is used to create a text input field in HTML?

A) <input>
B) <textarea>
C) <textfield>
D) <input type="text">
Ans – D

Which attribute in a form input tag is used to define a placeholder?

A) value
B) alt
C) text
D) placeholder
Ans - D

What does the <table> tag in HTML represent?

A) Inline element
B) Block element
C) A table layout
D) A form
Ans- C

Which tag is used to define a table row?

A) <tr>
B) <td>
C) <th>
D) <table>
Ans- A

In an HTML/XHTML table, which tag is used to define a table cell?

A) <td>
B) <tr>
C) <table>
D) <cell>
Ans - A

The <th> tag is used to create:

A) Table rows
B) Table headers
C) Table footers
D) Table data
Ans- B

Which attribute is used to define the number of columns a <td> should span?

A) span
B) colspan
C) width
D) colwidth
Ans - B
What does the <header> element represent in HTML5?

A) The main content


B) A section header
C) The website footer
D) Table header
Ans - B

What is the primary purpose of the <br> tag in HTML?

A) To add bold text


B) To create a line break
C) To add a background color
D) To create a new paragraph
Ans - B

Which of the following is a correct way to link an external CSS file named "styles.css"?

A) <link href="styles.css" rel="stylesheet">


B) <style src="styles.css"></style>
C) <link rel="stylesheet" src="styles.css">
D) <link href="styles.css" type="text/css">
Ans - A

Which tag is commonly used for navigation links in HTML5?

A) <nav>
B) <footer>
C) <aside>
D) <section>
Ans - A

CSS stands for:

A) Cascading Style Scripts


B) Cascading Styling Sheet
C) Cascading Style Sheets
D) Custom Style Sheet
Ans- C
Which attribute specifies the path to an external CSS file?

A) src
B) rel
C) href
D) path
Ans-
What is the purpose of the class attribute in CSS?

A) To style multiple elements


B) To select IDs
C) To add JavaScript
D) To create lists
Ans - A

In CSS, which symbol is used to select an element by its ID?

A) .
B) *
C) #
D) %
Ans - C
Which of the following is the correct syntax to set the background color in CSS?

A) bg-color: blue;
B) background: blue;
C) background-color: blue;
D) color-background: blue;
Ans - C

One benefit of using external CSS is:

A) Styles can be applied to multiple pages


B) It increases load time
C) Styles can only be applied to a single page
D) It’s easier to debug than inline CSS

Where is the <style> tag for internal CSS typically placed in an HTML document?

A) Inside the <body> section


B) Inside the <footer> section
C) Inside the <head> section
D) Outside the HTML document
Ans - C

Which type of selector is used to select elements with a specific ID?

A) Universal Selector
B) Class Selector
C) ID Selector
D) Group Selector
Ans- C

What does HTTP stand for?


a) HyperText Transfer Protocol
b) HyperTransfer Text Protocol
c) HyperText Transmission Protocol
d) Hyperlink Transfer Protocol
Answer: a) HyperText Transfer Protocol

Which protocol is primarily used for transferring data over the web?

a) FTP
b) HTTP
c) SMTP
d) POP3
Answer: b) HTTP

Which of the following defines the WWW?

a) A web server
b) A collection of web pages and resources
c) A web browser
d) An email service
Answer: b) A collection of web pages and resources

Which of the following is NOT a function of a web browser?

a) Rendering HTML
b) Requesting and displaying web pages
c) Managing URLs
d) Storing website content permanently
Answer: d) Storing website content permanently

What does MIME stand for?

a) Media Information Management Extension


b) Multimedia Internet Mail Extensions
c) Multi-Internet Media Encoding
d) Mobile Internet Mail Encoding
Answer: b) Multimedia Internet Mail Extensions

Which of the following is a key difference between HTTP and HTTPS?

a) HTTPS uses a secure encryption method


b) HTTP is for websites, while HTTPS is for emails
c) HTTPS is faster than HTTP
d) HTTP cannot be used for secure transactions
Answer: a) HTTPS uses a secure encryption method

Which component of the web is responsible for delivering content to browsers?

a) Web Browser
b) Web Server
c) Search Engine
d) URL
Answer: b) Web Server

Which of the following defines a URL?

a) Uniform Retrieval Locator


b) Universal Resource Locator
c) Uniform Resource Locator
d) Universal Retrieval Locator
Answer: c) Uniform Resource Locator

Which of the following is NOT a valid part of a URL?

a) Protocol
b) Path
c) Query string
d) Browser
Answer: d) Browser

Which tag is used to define a hyperlink in HTML?

a) <a>
b) <link>
c) <img>
d) <href>
Answer: a) <a>

You might also like