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

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. An HTML document can contain _____

A Attributes

B Tags

C Raw text

D All the answers are true

An HTML document can contain attributes, tags, and plain text. Example :



2. A page designed in HTML is called _____

A Application

B Cover page

C Front-end

D Web Page

A web page is a document typically written in Hypertext Markup Language (HTML) that can be accessed over the Internet or other networks using an Internet browser. A web page is accessed by entering a URL address and can contain text, graphics, and hyperlinks to other web pages and files. The page you are currently reading is an example of a web page.



3. An HTML document is saved with the ____ extension.

A .htl

B .html

C .hml

D .htnl

Example : myWebPage.html



4. The HTML document contains a root tag called ____


B Title

C Body


Here is an example of a simple HTML document:
      <TITLE>My first HTML document</TITLE>
      <P>Welcom To!</P>



5. If we want to place text around an image, which CSS property should we use?

A push

B float

C align

D wrap

The “float” property indicates that an item should be placed on the right or left side of its container. Example:



6. Can we align an element by setting margin-left and margin-right?

A Yes it’s possible.

B No, it’s not possible.

An element always starts on a new line and occupies the entire available width.


7. Suppose we want to arrange three DIVs so that DIV 3 is placed above DIV1. Now, which CSS property are we going to use to control the stack order?
A d-index

B s-index

C x-index

D z-index

The z-index property specifies the stack order of an element. Example:



8. Can we define the direction of the text via a CSS property?

A Yes it’s possible.

B No, it’s not possible.

The property “direction” in CSS defines the direction of an element’s content flow. Example:
direction: rtl;  /* Right to Left */



9. Choose the correct HTML tag for a large title.

A H1

B Heading

C Head

D H6

The elements h1 to h6 represent six levels of titles in an HTML document. Example:
<h1>Title of level 1</h1>
<h2>Title of level 2</h2>
<h3>Title of level 3</h3>
<h4>Title of level 4</h4>
<h5>Title of level 5</h5>
<h6>Title of level 6</h6>

Title of level 1

Title of level 2

Title of level 3

Title of level 4

Title of level 5
Title of level 6



10. If we want to use a nice green dotted border around an image, which css property are we going to use?

A border-line

B border-style

C border-decoration

D border-color

B, D
Example :
div {
  border-style: dotted;
  border-color: green;  
<div>Welcom to</div>



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

2 thoughts on “HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 2

  • Maureen Wanjiru

    Mmm interesting. I am enrolling in full stack developer and I think this is a great testing experience.


    It’s very educative


Leave a Reply

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