Placement_Prepration

CSS Multiple Choice Questions


Q. When you need a list with no bullets, what approach should you use?

list-unstyled

Q. By default, flex elements are inline level elements?

false

Q. To force the space between the elements to be the same, you use?

nav-justified

Q. Relative unit values are relative to the _____ of another property?

length

Q. When checking browser support, you are actually looking at _____.?

rendering engines

Q. _____ are fixed units, while _____ are relative units, which means that font size will be relative to a device’s default size.

Pixels; ems

Q. Saturation represents the amount of _____, with 100% being fully saturated and 0% being grayscale.

color

Q. Fixed elements are considered to be absolutely positioned, but they’re always positioned relative to the _____.

active viewport

Q. What is the correct way to define a variable in Sass?

A. $primary-color: #888
B. @primary-color: #888
C. %primary-color: #888
D. #primary-color: #888

Answer: Option A. $primary-color: #888  

Explanation: Following is the correct way to define a variable in SASS, $primary-color: #888;

SASS Variables allow you to define a value once and use it in multiple places. Variables begin with dollar signs and are set like CSS properties. You can change the value of the variable in one place, and all instances where it is used will be changed, too.

Q. What are the data types that SassScript supports?

A. Numbers
B. Strings of texts
C. Colors D. All of these

Answer: Option D

Q. @debug directive detects the errors and displays the SassScript expression values to the standard error output stream.

a. True b. False

Answer: a.  True

Explanation: The above statement is true. The @debug directive detects the errors and displays the SassScript expression values to the standard error output stream.

Q. Which of the following directive is used to share rules and relationships between selectors?

a. @extend
b. @media
c. @extend
d. None of the above

Answer: a. @extend

Explanation: The @extend directive is used to share rules and relationships between selectors. This directive extends all another class styles in one class and can also apply its own specific styles.

Q. ___________ directive is a collection of nested rules, which is able to make style block at root of the document.

a. @at-root
b. @media
c. @extend
d. None of the above

Answer: a. @at-root

Explanation: The @at-root directive is a collection of nested rules, which is able to make style block at root of the document. This selector excludes the selector by default. By using @at-root, we can move the style outside of nested directive.

Q. Which of the following directive displays the SassScript expression value as fatal error?

a. @error
b. @warn c. @at-root d. None of the above

Answer: a. @error

Explanation: The @error directive displays the SassScript expression value as fatal error.

Q. In __________ directive, a variable is defined which contains the value of each item in a list.

a. @if
b. @each
c. @for
d. @while

Answer: b. @each

Explanation: In @each directive, a variable is defined which contains the value of each item in a list.

Q. Which of the following directive allows you to generate styles in a loop?

a. @while
b. @if
c. @for
d. @each

Answer: c. @for

Explanation: The @for directive allows you to generate styles in a loop. The @for directive comes in two forms. The first option is @for $var from <start> through <end> which starts at <start> and loops “through” each iteration and ends at <end>. And the second option is @for $var from <start> to <end> which starts at <start> and loops through each iteration “to” <end> and stops. Once the directive hits the <end>, it stops the looping process and does not evaluate the loop that one last time.

Q. The SassScript values can be taken as arguments in mixins, which is given when mixin is included and available as variable within the mixin.

a. True
b. False

Answer: a. True

Explanation: The above statement is true. The SassScript values can be taken as arguments in mixins, which is given when mixin is included and available as variable within the mixin. Mixins allow creating a group of styles, which are reusable throughout your stylesheet without any need to recreation of non-semantic classes.

Q. What is the use of the @include directive in Sass?

a. Used to define the mixin.
b. Used to include the mixins in the document.
c. All of the above
d. None of the above

Answer: b. Used to include the mixins in the document.

Explanation: In Sass, the @include directive is used to include the mixins in the document. The styles defined by the mixin can be included into the current rule.

Q. What is the use of the @return directive in Sass?

a. Used to define the mixin.
b. Used to include the mixins in the document.
c. Used to call the return value for the function.
d. None of the above

Answer: c. Used to call the return value for the function.

Explanation: In Sass, the @return directive is used to call the return value for the function.

Q. Which of the following operator provides the path for the CSS stylesheets in the application.

a. :filename
b. :load_paths
c. :css_location
d. :template_location

Answer: c. :css_location

Explanation: The :css_location operator provides the path for the CSS stylesheets in the application.

Q. “sass input.scss output.css” command is used to run the SASS code from the command line.

a. True
b. False

Answer: a. True