MCQ

HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 3

Multiple choice questions and answers (MCQs) on HTML/CSS to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on basic techniques such as tags, web standards, CSS selector, objects, and more. This quiz will easily prepare anyone to pass their online test.
 

1. Which tag is used to display pre-formatted text?

A <pre> … </pre>

B <prefor> … </prefor>

C <p> … </p>

D <pre-format> … </pre-format>

A
The <pre> tag represents preformatted text.

 

 

2. How to add alternative text to an image?

A <img src = “https://stackhowto.com/logo.png” alternate = “logo” />

B <img src = “https://stackhowto.com/logo.png” alt text = “logo” />

C <img src = “https://stackhowto.com/logo.png” alternate text = “logo” />

D <img src = “https://stackhowto.com/logo.png” alt = “logo” />

D
The value of the “alt” attribute is a textual description that is assigned to an image.

 

 
 

3. How to embed audio files in HTML?

A <embed src = “audio.mp3” width = “50” height = “10”>

B <embed sound = “audio.mp3” width = “50” height = “10”>

C <embed audio = “audio.mp3” width = “50” height = “10”>

D <embed music = “audio.mp3” width = “50” height = “10”>

A
The tag <embed> defines a container for an external application or interactive content.

 

 

4. In HTML, Uniform Resource Locator (URL) is used _____

A To create a frame document.

B To create an image map in a web page.

C To customize the image in a web page.

D To identify a name or a resource on the Internet.

D
A URL (Uniform Resource Locator) is a unique identifier used to locate a resource on the Internet. It is also called a Web address. URLs are made up of several parts – including a protocol and a domain name – that tell the Web browser where and how to retrieve a resource. Example: https://stackhowto.com/html-css-mcqs-multiple-choice-questions-and-answers-part-1/

 

 

5. CSS is an acronym for _____

A Cascading Style Sheet

B Costume Style Sheet

C Cascading System Style

D None of the above

A
Cascading Style Sheets (CSS) is a language used to describe the presentation of a document written in a markup language such as HTML.

 

 
 

6. Which of the following protocols is not used on the Internet?

A Gopher

B HTTP

C WIRL

D Telnet

C
  • HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, audio, video and other multimedia files) over the World Wide Web.
  • Telnet is a network protocol used to access remote computers and terminals over the Internet or a TCP/IP computer network.
  • Gopher is an application layer protocol for retrieving and displaying web documents stored on remote web servers.

 

 

7. What should be the value of the “width” property of the following table: (<table style="width:'???'">), to make the width of the table fit the current width of the browser window?

A 100%

B 640px

C 100em

D 1024px

A
100% refers to the total width of the browser window.

 

 

8. Which element is used in <HEAD> of an HTML/XHTML page, if we want to use an external CSS to decorate the page?

A <src>

B <link>

C <style>

D <css>

B
The tag <link> defines a link between a document and an external resource. Example:
<link rel="stylesheet" type="text/css" href="style.css">

 

 
 

9. What attribute can be added to many HTML/XHTML elements to identify them as a member of a specific group?

A Id

B class

C div

D span

B
A class is used to identify several elements, and its name is preceded by a dot (.). Example:
<html>
	<head>
		<style>
			.city {
			  background-color: blue;
			  color: yellow;
			} 
		</style>
	</head>
	<body>
		<p class="city">London is the capital of England.</p>
		<p class="city">Paris is the capital of France.</p>
		<p class="city">Tokyo is the capital of Japan.</p>
		<p class="city">Rabat is the capital of Morocco.</p>
	</body>
</html>
 

10. When we write <img src = "img.png">, what does “img.png” imply?

A element

B attribute

C value

D operator

C
Example:

 

 

mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *