PDF Css Zinab
PDF Css Zinab
2. Which HTML tag is used to include CSS styles directly within an HTML
document?
a. <style>
b. <link>
c. <script>
d. <css>
Answer: a) <style>
4. How do you select an HTML element with the id attribute "header" in CSS?
a. #header
b. .header
c. header
d. <header>
Answer: a) #header
5. Which CSS property is used to control the spacing between lines of text
within an element?
a. padding
b. margin
c. line-height
d. spacing
Answer: c) line-height
10. Which CSS selector selects all elements with a specific class attribute?
a. #element
b. .class
c. element.class
d. element > .class
Answer: b) .class
14.What is the correct order of CSS rule specificity, from highest to lowest?
1. Inline styles, ID selectors, Class selectors, Element selectors
2. ID selectors, Inline styles, Class selectors, Element selectors
3. Element selectors, Class selectors, ID selectors, Inline styles
4. Class selectors, ID selectors, Inline styles, Element selectors
Answer: b) ID selectors, Inline styles, Class selectors, Element selectors
15.If you have conflicting CSS rules for an element, which rule will take
precedence?
1. The rule with the highest specificity
2. The rule that appears first in the stylesheet
3. The rule with the lowest specificity
4. The rule with the most properties
Answer: a) The rule with the highest specificity
CSS Comments:
CSS Colors:
CSS Backgrounds:
CSS Borders:
20.How can you set the border of an element to be a dashed line in CSS?
1. border-style: dashed;
2. border-line: dashed;
3. border: dashed;
4. border-design: dashed;
b. Answer: a) border-style: dashed;
MCQS OF CSS(cascading style sheets)
21.To set the width of a border in CSS, which property should be used?
1. border-size
2. border-width
3. border-thickness
4. border-height
b. Answer: b) border-width
27.Which CSS property is used to control the spacing between list items in an
unordered list?
1. list-item-spacing
2. list-spacing
3. margin
4. padding
Answer: c) margin
28.What CSS property is used to set the spacing between cells in a table?
1. table-spacing
2. cell-spacing
3. border-spacing
4. padding-spacing
Answer: c) border-spacing
30.Which CSS display value is used to make an element take up the entire
width of its container?
1. block
2. inline
3. inline-block
MCQS OF CSS(cascading style sheets)
4. flex
Answer: a) block
31.What display value is used to hide an element but keep the space it
occupies?
1. hidden
2. none
3. visible
4. block
Answer: b) none
Answer: d. static
Answer: a. ID selector
38.In CSS, which property can be used to override a conflicting style rule?
a. !important
b. override
c. override-rule
d. specificity
Answer: a. !important
40.Which CSS property is used to set the space between the content and the
border of an element?
a. margin
b. padding
c. border-spacing
d. spacing
Answer: b. padding
44.What is the default value of the "display" property in CSS for most
elements? a. inline
b. block
c. inline-block
d. none
Answer: b. block
CSS Positioning
MCQS OF CSS(cascading style sheets)
45.Which CSS property is used to make an element stick to the top of the
viewport when scrolling?
a. fixed
b. absolute
c. sticky
d. relative
Answer: c. sticky
47.Which CSS value can be used to hide an element without affecting the
layout?
a. display: block;
b. visibility: hidden;
c. opacity: 0;
d. position: absolute;
Answer: c. opacity: 0;
CSS Typography
MCQS OF CSS(cascading style sheets)
50.Which CSS property is used to control the spacing between lines of text?
a. text-spacing
b. line-height
c. letter-spacing
d. word-spacing
Answer: b. line-height
56.Which CSS property is used to define the direction of flex items within a
flex container?
a. flex-direction
b. flex-flow
c. flex-wrap
d. flex-align
**Answer: