250+ TOP MCQs on Applying Style to a Document and Answers

CSS Interview Questions and Answers for freshers on “Applying Style to a Document”.

1. Which of the following is the correct way to applying style to a document?
a) Use an external style sheet, either by importing it or by linking to it
b) Directly embed a document-wide style in the head element of the document
c) Set an inline style rule using the style attribute directly on an element
d) All of the mentioned

Answer: d

2. What will be the output of following code snippet?

<style h1 {color: green;}> 
<h1>Hello</h1>

a) h1 heading becomes green
b) error
c) h1 heading disappears
d) nothing happens

Answer: c

3. What will be the output of below mentioned code snippet?

<p style="color: red">text</p>

a) make that specific paragraph red.
b) error
c) nothing happens
d) none of the mentioned

Answer: a

4. The _______property is used to set the color of the text.
a) pallet
b) colour
c) color
d) text-decoration

Answer: c

5. Which of the following is the correct way to apply Styles?
a) inside an HTML element
b) inside the section of an HTML page
c) in an external CSS file
d) all of the mentioned
View Answer

Answer: d

6. Which of the following CSS list properties is/are correct?
a) Set different list item markers for ordered lists
b) Set different list item markers for unordered lists
c) Set an image as the list item marker
d) All of the mentioned

Answer: d

7. A ___________ is used to define a special state of an element.
a) pseudo-tag
b) pseudo-element
c) pseudo-id
d) pseudo-class

  250+ TOP MCQs on Specificity and Importance and Answers

Answer: d

8. The __________ property specifies the type of positioning method used for an element.
a) align
b) float
c) position
d) padding

Answer: c

9. Which style is this?

<body style="background-color: lightcyan">

a) Inline Styles
b) External Style Sheet
c) External Style Sheettyle Sheet
d) None of the mentioned

Answer: a

10. Is this correct way to apply css.State true or false.

<link rel="stylesheet" type="text/css" href="mystyle.css">

a) True
b) False

Answer: a

Leave a Comment

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

Scroll to Top