HTML/CSS MCQ

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

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. What is CSS?

A CSS is a style sheet language

B CSS is designed to separate presentation and content, including layout, colors, and fonts.

C CSS is the language used to style HTML documents

D All of the above

D
CSS is a style sheet language which stands for Cascading Style Sheets and is used to style HTML documents. CSS is mainly designed to separate presentation and content, including layout, colors, and fonts.
 

2. Which of the following CSS frameworks is used to create responsive design?

A django

B rails

C laravel

D bootstrap

D
Bootstrap is a free and open-source toolkit for developing websites and web applications. It includes HTML and CSS templates for typography, forms, buttons, navigation, and other interface components, as well as optional JavaScript extensions. It is aimed at making the development of dynamic websites and applications easier.
 

3. Which of the following CSS properties is used to make text bold?

A text-decoration: bold

B font-weight: bold

C font-style: bold

D text-align: bold

B
The font-weight property is used to set the thickness and boldness of the font. It defines the weight of the text. The available weights depend on the font family used by the browser.
 
 

4. What will be the result of the following CSS code snippet?
h1 {color: "blue";}

A nothing happens

B an error occurs

C the heading turns dark blue

D the heading turns blue

A
The output of the above code snippet will not occur because the syntax is incorrect. The correct declaration is: h1 {color: blue;}. In CSS, we do not enclose the value in quotation marks.
 

5. Which of the following CSS style properties is used to specify italic text?

A style

B font

C font-style

D @font-face

C
The font-style property is used to specify italic text. The font-style property has three values (normal, italic, and oblique). Example: p { font-style: italic;}
 

6. What will be the result of the following CSS code snippet?
h1 {color : blue text-decoration : underline; font-style : italic;}

A color : blue text-decoration : underline; works

B only font-style : italic; works

C everything works

D text-decoration : underline; font-style : italic; works

B
In this case, the browser will try to parse the value of color as “blue text-decoration : underline” before reaching a final semicolon. The following font-style property will be used. The color property, having an invalid value, will be ignored.
 
 

7. Which of the following are CSS vendor prefixes for Webkit?

A -chrome

B -web

C -o-

D -webkit

D
Browsers sometimes add prefixes to non-standard CSS properties. The CSS vendor prefix for Webkit is -webkit, supported by almost all iOS browsers. The -o prefix is used by Opera and -moz is used by Firefox. Example:

h2 {
    /* WebKit */
    -webkit-appearance: button !important;
    /* Mozilla */
    -moz-appearance: button;
    /* Opera */
    -o-appearance: button;
    /* Internet Explorer */
    -ms-appearance: button;
    /* CSS3 */
    appearance: button;
    width: 500px;
    padding: 2em;
    color: #fff;
}
 

8. Which of the following specifications was the first CSS specification to become an official W3C recommendation?

A CSS 2

B CSS (X)HTML

C CSS 1

D CSS 2.1

C
The first CSS specification to become an official W3C recommendation was CSS 1, published on December 17, 1996. Håkon Wium Lie and Bert Bos were the original developers.
 

9. Which of the following functions defines a linear gradient as an image in CSS?

A gradient()

B linear-gradient()

C grayscale()

D image()

B
The linear-gradient() function defines a linear gradient as a CSS image. When creating a linear gradient function, at least two color stops must be defined. These tell the browser which colors to use to ensure smooth transitions. See an example.
 
 

10. Which of the following CSS properties can be used to set an image as the border instead of a border style?

A background-image-source

B background-image

C border-image-source

D border-image

C
The border-image-source property specifies the path to the image to be used as a border (instead of the usual border around an element). Example:

p#border {
   border: 15px solid transparent;
   padding: 16px;
   border-image-source: url(border.png);
   border-image-slice: 25;
}

Result:

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 *