FSD CSS
FSD CSS
1. What is CSS?
a) CSS is a style sheet language
b) CSS is designed to separate the presentation and content, including layout, colors, and fonts
c) CSS is the language used to style the HTML documents
d) All of the mentioned
Answer: d
Explanation: CSS is a style sheet language that stands for Cascading Style Sheet and is used to style
HTML documents. CSS is mainly designed to separate the presentation and content, including layout,
colors, and fonts.
3. Which of the following CSS selectors are used to specify a group of elements?
a) tag
b) id
c) class
d) both class and tag
Answer: c
Explanation: Class selectors are used to specify a group of elements. Id selector specifies a particular
unique element.
4. Which of the following has introduced text, list, box, margin, border, color, and background
properties?
a) HTML
b) PHP
c) CSS
d) Ajax
Answer: c
Explanation: CSS is a style sheet language that stands for Cascading Style Sheet. CSS has introduced
text, list, box, margin, border, color, and background properties.
5. Which of the following CSS framework is used to create a responsive design?
a) django
b) rails
c) larawell
d) bootstrap
Answer: d
Explanation: Bootstrap is a free and open-source collection of tools for creating websites and web
applications. It contains HTML- and CSS-based design templates for typography, forms, buttons,
navigation and other interface components, as well as optional JavaScript extensions. It aims to ease
the development of dynamic websites and web applications.
6. Which of the following CSS selector is used to specify a rule to bind a particular unique element?
a) tag
b) id
c) class
d) both class and tag
Answer: b
Explanation: For binding a particular unique element, id selectors are used. While for a group of
elements, class selector can be used.
7. Which of the following type of HTML tag is used to define an internal style sheet?
a) <script>
b) <link>
c) <class>
d) <style>
Answer: d
Explanation: <style> tag is used to define an internal style sheet in HTML document.
8. Which of the following CSS property is used to make the text bold?
a) text-decoration: bold
b) font-weight: bold
c) font-style: bold
d) text-align: bold
Answer: b
Explanation: The font-weight property is used for setting the thickness and boldness of the font. It is
used to define the weight of the text. The available weight depends on the font-family, which is used by
the browser.
h1 {color: "green";}
a) nothings happen
b) error occurs
c) heading becomes dark-green
d) heading becomes green
Answer: a
Explanation: Output of the above code snippet won’t happen as the declaration syntax is wrong. The
correct declaration is : h1 { color: green; } which will yield an output. In CSS, we don’t write the value
in double quotes.
10. Which of the following CSS style property is used to specify an italic text?
a) style
b) font
c) font-style
d) @font-face
Answer: c
Explanation: font-style property is used to specify an italic text. font-style property has three values
(normal, italic & oblique).
12. Which of the following are the CSS Extension Prefixes for Webkit?
a) -chrome
b) -web
c) -o-
d) -webkit
Answer: d
Explanation: Browser sometimes adds prefixes to non-standard CSS properties. CSS Extension prefix
for Webkit is -webkit which is supported by almost all ios browsers. -o is used by opera where as -moz
is used by firefox browser.
13. Which of the following is the correct syntax to link an external style sheet in the HTML file?
a) <link rel=”stylesheet” href=”style.css” />
b) <link rel=”stylesheet” src=”style.css” />
c) <style rel=”stylesheet” src=”style.css” />
d) <style rel=”stylesheet” link=”style.css” />
Answer: a
Explanation: HTML file must contain a reference to the external style sheet file. External style sheet
files are defined within the <link> element and it should be inside the <head> section. href attribute
specifies the URL of the linked resource.
14. Which of the following is the first CSS specification to become an official W3C Recommendation?
a) CSS level 2
b) (X)HTML CSS
c) CSS level 1
d) CSS level 2.1
Answer: c
Explanation: The first CSS specification to become an official W3C Recommendation is CSS level 1,
published on December 17, 1996. Håkon Wium Lie and Bert Bos are credited as the original
developers.
15. Which of the following function defines a linear gradient as a CSS image?
a) gradient()
b) linear-gradient()
c) grayscale()
d) image()
Answer: b
Explanation: linear-gradient() function defines a linear gradient as a CSS image. Creating a linear
gradient function we should define minimum of two color stops. color stops will tell the browser which
colors to use in the gradients for smooth transitions.
16. Which of the following CSS property can be used to set the image as a border instead of the border
style?
a) background-image-source
b) background-image
c) border-image-source
d) border-image
Answer: c
Explanation: The border-image-source property specifies the path to the image to be used as a border
(instead of the normal border around an element).
17. Which of the following CSS property defines the different properties of all four sides of an
element’s border in a single declaration?
a) border-collapse
b) border-width
c) padding
d) border
Answer: b
Explanation: The border-width property sets the width of an element’s four borders. This property can
have from one to four values.
18. Which of the following is the correct way to apply CSS Styles?
a) in an external CSS file
b) inside an HTML element
c) inside the <head> section of an HTML page
d) all of the mentioned
Answer: d
Explanation: We can style the document using CSS in three different ways i.e embed, inline and
external. An inline CSS means applying styles rules directly to the HTML element. In embed, we
declare or write all the needed style in <style></style> tag in the head section of the HTML document.
We can create an external style sheet and provide its link to the document.
19. Which of the following CSS property sets the font size of text?
a) font-size
b) text-size
c) text
d) size
Answer: a
Explanation: CSS Syntax:
font-size: length | percentage | larger | smaller | xx-small | x-small | small | medium | large | x-large | xx-
larger | inherit
20. Which of the following is not the property of the CSS box model?
a) margin
b) color
c) width
d) height
Answer: b
Explanation: CSS box model include height, width, padding, margin and border. All text-fields have
complete support for every property related to CSS box model. Browser relies on system default styles
when displaying these widgets.
21. Which of the following CSS property sets what kind of line decorations are added to an element,
such as underlines, overlines, etc?
a) text-decoration
b) text-style
c) text-decoration-line
d) text-line
Answer: c
Explanation: The text-decoration-line property defines the type of line decorations that are added to an
element, such as underlines, overlines, etc.
22. Which of the following CSS property specifies the look and design of an outline?
a) outline-style
b) outline-format
c) outline-font
d) none of the mentioned
Answer: a
Explanation: The outline-style CSS property is used to set the style of the outline of an element. An
outline is a line that is drawn around elements, outside the border edge, to make the element stand out.
23. What will be the output of the following CSS code snippet?
span {
border: 1px solid red;
outline: green dotted thick;}
a) All span elements will have a green thick border and a red outline
b) All span elements will have a red border and a green dotted outline
c) All span elements will have a outer green dotted border and an inner red border
d) All span elements will have an outer red border and inner green dotted border
Answer: c
Explanation: The border property creates the inner border, while the outline sets the outer border.
24. Which of the following CSS property sets the shadow for a box element?
a) set-shadow
b) box-shadow
c) shadow
d) canvas-shadow
Answer: b
Explanation: box-shadow property sets the shadow for a box element.
CSS Syntax:
26. Which of the following CSS Property controls how an element is positioned?
a) static
b) position
c) fix
d) set
Answer: b
Explanation: Position property controls how an element is positioned. When set to absolute or fixed,
the element is removed completely from the normal flow of the document. When set to relative, the
element is moved relative to its position in the normal flow, but a space is left where it would normally
have been. The default value, static, means the element remains in the normal flow and is not
positioned.
27. Which of the following CSS selector selects the elements that are checked?
a) :checked
b) E ~ F
c) ::after
d) none of the mentioned
Answer: a
Explanation: :checked selector selects the elements that are checked.
visible|hidden|scroll|auto|initial|inherit
29. Which of the following CSS property is used to specify table borders in CSS?
a) table:border
b) table
c) border
d) none of the mentioned
Answer: c
Explanation: In CSS, border property is used to specify table borders.
Example:
table{text-align: left;}
31. Which of the following CSS Property sets the stacking order of positioned elements?
a) y-index
b) z-index
c) x-index
d) all of the mentioned
Answer: b
Explanation: z-index property sets the stacking order of positioned elements.
Syntax:
z-index: auto|number|initial|inherit;
32. What will be the output of the following CSS code?
div {
border-width:5px;
border-style:dotted solid double dashed;}
a) Box having dotted bottom outline, solid right outline, double top outline and dashed left outline
b) Box having dotted bottom outline, solid left outline, double top outline and dashed left outline
c) Box having dotted top outline, solid right outline, double bottom outline and dashed left outline
d) Box having dotted top outline, solid left outline, double bottom outline and dashed right outline
Answer: c
Explanation: The shorthand run in clockwise direction.
33. Which of the following property allows a marquee to be used in the case of a text-overflow?
a) overflow-marquee
b) overflow-style
c) overflow-text
d) none of the mentioned
Answer: b
Explanation: overflow-style is a CSS property that allows a marquee to be used in the case of a text-
overflow.
Syntax:
overflow-style: auto | marquee-block
34. Which of the following CSS property defines the space between cells in a table?
a) border-spacing
b) border-style
c) border
d) none of the mentioned
Answer: a
Explanation: border-spacing property defines the space between cells in a table.
Syntax: