MCQ

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

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. In order to upload an HTML file to a web server, you use ______?

A HTTP

B SMTP

C SIP

D FTP

D
FTP (File Transfer Protocol) is a network protocol used to transfer files between a client and a server via the Internet.
 

2. In HTML5 we specify _______ so that the browser displays the page in standard mode.

A DOCTYPE

B HEAD

C BODY

D TITLE

A
The <!DOCTYPE> declaration must be declared in the first line in your HTML document, before the <html> tag.

The <!DOCTYPE> statement is not an HTML tag; it is an instruction to inform the browser about the version of HTML in which the page is written.

 

 
 

3. An ordered list can be represented by ______.

A <ol>

B <ul>

C <li>

D <el>

A
An ordered list starts with the tag <ol>. Each element of the list starts with the tag <li>. Example:
<ol>
  <li>Lorem ipsum</li>
  <li>Lorem ipsum</li>
  <li>Lorem ipsum</li>
</ol>
Output :

  1. Lorem ipsum
  2. Lorem ipsum
  3. Lorem ipsum

 

 

4. Which of the attributes is mandatory in the <img> tag?

A src

B href

C id

D alt

A
The <img> element is defined with the required attribute src, which contains a URL pointing to the location of the image. Example :
<img src="../../images/test.jpg">

 

 

5. PNG means _______________

A Portable Network Graphic

B Pivot Network Graphic

C Pichart Network Graphic

D Pythagorus Network Graphic

A
The abbreviation PNG refers to Portable Network Graphics and represents a graphic format designed to store bitmap graphic images.

 

 
 

6. GIF means _______________

A Graph Interchange Format

B Graphics Interlinked Format

C Graphics Interchange Format

D None of the above

C
GIF is the oldest and most approved file format type for simple images. GIF represents a bitmap file format.

 

 

7. Which of the following CSS selectors selects an element that does not have sub-elements?

A :empty

B :nochild

C :inheritance

D :no-child

A
The “:empty” selector is used to select elements that contain no children (including text).
:empty {
    // CSS property
}

 

 

8. Which of the following CSS selectors selects an element if it is the only child of its parent?

A :nth-oftype(n)

B :only-child

C :root

D None of the above

B
Example: specify a background color for each element that is the only child of its parent:
p:only-child {
  background: #ff0000;
}

 

 
 

9. In css, what h1 can be called as ______

A Selector

B Attribute

C Value

D Label

A
CSS selectors allow you to select the content you want to style. Selectors are part of the CSS ruleset. CSS selectors select HTML elements based on their identifier, class, type, attribute, etc.


 

 

10. In css, what can “color:red” be called?

A Rule

B Attribute

C Value

D Declaration

D
A set of CSS rules consists of a selector and a declaration block.


 

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 *