CSS MCQs

  1. What does CSS stand for?
    a) Creative Style Sheets
    b) Cascading Style Sheets ✅
    c) Computer Style Sheets
    d) Colorful Style Sheets

  2. Which HTML tag is used to link an external CSS file?
    a) <style>
    b) <link>
    c) <css>
    d) <stylesheet>

  3. Which property is used to change the background color?
    a) color
    b) background-color ✅
    c) bg-color
    d) bgcolor

  4. Which of the following is the correct CSS syntax?
    a) body:color=black;
    b) {body:color=black;}
    c) body {color: black;} ✅
    d) {body;color:black;}

  5. What is the correct place to link the CSS file in HTML?
    a) Inside <body>
    b) Inside <head>
    c) Anywhere
    d) At the end of <html>

  6. Which symbol is used for ID selector in CSS?
    a) .
    b) # ✅
    c) *
    d) @

  7. Which symbol is used for class selector in CSS?
    a) *
    b) . ✅
    c) #
    d) %

  8. What is the default value of the position property?
    a) fixed
    b) absolute
    c) relative
    d) static ✅

  9. Which property is used to change text color?
    a) font-color
    b) text-color
    c) color ✅
    d) background-color

  10. Which property is used to make text bold?
    a) font-weight ✅
    b) font-style
    c) font-decoration
    d) font-bold

  11. What is the correct syntax to comment in CSS?
    a) <!– comment –>
    b) // comment //
    c) /* comment */ ✅
    d) # comment

  12. Which property controls the size of text?
    a) text-size
    b) font-size ✅
    c) font-style
    d) size

  13. How do you select all <p> elements inside a <div>?
    a) div p ✅
    b) div+p
    c) div.p
    d) div#p

  14. Which property is used to set space between letters?
    a) letter-spacing ✅
    b) word-spacing
    c) text-spacing
    d) spacing

  15. The CSS property used to underline text is:
    a) text-line
    b) underline
    c) text-decoration ✅
    d) font-decoration

  16. Which property is used to align text to the center?
    a) text-align ✅
    b) align
    c) font-align
    d) center

  17. How do you apply a style to all <h1> elements?
    a) .h1 {}
    b) #h1 {}
    c) h1 {} ✅
    d) heading {}

  18. Which property controls the left margin of an element?
    a) margin-left ✅
    b) padding-left
    c) space-left
    d) left-margin

  19. How can you make a list display horizontally?
    a) list-direction: horizontal;
    b) display: inline; ✅
    c) float: left;
    d) display: block;

  20. Which property is used to set the space between lines?
    a) line-spacing
    b) line-height ✅
    c) spacing
    d) text-height

  21. Which value of display hides an element but keeps space?
    a) hidden
    b) none
    c) visibility: hidden ✅
    d) display: invisible

  22. What does the z-index property control?
    a) Transparency
    b) Layer order ✅
    c) Font size
    d) Position

  23. Which property adds space inside an element?
    a) margin
    b) padding ✅
    c) spacing
    d) border

  24. Which property adds space outside an element?
    a) margin ✅
    b) padding
    c) spacing
    d) border

  25. The float property can take which value?
    a) left ✅
    b) top
    c) middle
    d) center

  26. What does overflow: hidden; do?
    a) Hides overflow content ✅
    b) Displays overflow
    c) Wraps text
    d) Clips only horizontally

  27. Which unit is relative to the root element font size?
    a) em
    b) rem ✅
    c) px
    d) %

  28. Which CSS property defines shadow around text?
    a) text-shadow ✅
    b) box-shadow
    c) shadow
    d) font-shadow

  29. How to make a border dashed?
    a) border-type: dashed;
    b) border-style: dashed; ✅
    c) border-line: dashed;
    d) border-dash: true;

  30. Which of these properties can center a block element?
    a) margin: auto; ✅
    b) align: center;
    c) padding: auto;
    d) float: center;

  31. Which property changes the shape of the mouse cursor?
    a) pointer-type
    b) cursor ✅
    c) mouse
    d) hover

  32. The border-radius property is used to:
    a) Add shadow
    b) Round corners ✅
    c) Create borders
    d) Add padding

  33. Which property controls element transparency?
    a) visibility
    b) opacity ✅
    c) alpha
    d) color

  34. How to select elements with both class “a” and “b”?
    a) .a, .b
    b) .a.b ✅
    c) a.b
    d) a,b

  35. Which pseudo-class targets the first child of a parent?
    a) :child
    b) :first-child ✅
    c) :first
    d) :nth

  36. Which property controls animation speed curve?
    a) animation-delay
    b) animation-timing-function ✅
    c) animation-curve
    d) animation-pace

  37. Which property specifies transition duration?
    a) transition-time
    b) transition-delay
    c) transition-duration ✅
    d) duration

  38. Which property sets the layout direction in flexbox?
    a) flex-direction ✅
    b) flex-flow
    c) flex-align
    d) justify-direction

  39. What does display: flex; do?
    a) Creates a grid
    b) Creates a flex container ✅
    c) Centers elements
    d) Hides element

  40. Which property aligns items along the main axis?
    a) justify-content ✅
    b) align-items
    c) flex-align
    d) align-content

  41. Which value of position fixes an element relative to viewport?
    a) fixed ✅
    b) absolute
    c) relative
    d) static

  42. Which property defines the height of an element?
    a) element-height
    b) height ✅
    c) size
    d) block-height

  43. What property can control element visibility?
    a) visible
    b) display
    c) visibility ✅
    d) show

  44. Which value of display creates an inline container?
    a) inline ✅
    b) block
    c) flex
    d) table

  45. Which property changes the order of flex items?
    a) flex-order
    b) order ✅
    c) flex-index
    d) sort

  46. Which property is used for responsive breakpoints?
    a) @screen
    b) @media ✅
    c) @device
    d) @query

  47. Which property adds a shadow around boxes?
    a) box-shadow ✅
    b) border-shadow
    c) element-shadow
    d) shadow

  48. Which CSS feature supports custom properties?
    a) Variables ✅
    b) Mixins
    c) Constants
    d) Tokens

  49. Which property controls how background repeats?
    a) background-repeat ✅
    b) repeat
    c) bg-repeat
    d) background-loop

  50. Which color format supports alpha transparency?
    a) RGB
    b) HEX
    c) RGBA ✅
    d) HSL

  1. Which property controls the width of an element’s border?
    a) border-size
    b) border-width ✅
    c) border-style
    d) border-spacing

  2. Which of the following is NOT a valid CSS unit?
    a) px
    b) em
    c) pt
    d) gm ✅

  3. How do you make text italic in CSS?
    a) font-variant: italic;
    b) font-style: italic; ✅
    c) text-style: italic;
    d) text-decoration: italic;

  4. The :hover pseudo-class is used for:
    a) Clicking an element
    b) Focusing on an element
    c) When the mouse is over an element ✅
    d) Selecting an element

  5. What is the default display property for <span>?
    a) inline ✅
    b) block
    c) flex
    d) none

  6. Which property changes the background image of an element?
    a) background-img
    b) background-image ✅
    c) bg-image
    d) image

  7. The @font-face rule is used to:
    a) Include custom fonts ✅
    b) Add icons
    c) Create transitions
    d) Define gradients

  8. Which property defines space between words?
    a) word-spacing ✅
    b) letter-spacing
    c) line-spacing
    d) text-indent

  9. Which property defines how the background image is positioned?
    a) background-position ✅
    b) image-position
    c) position
    d) bg-align

  10. What value of overflow will add scrollbars?
    a) auto ✅
    b) hidden
    c) visible
    d) none

  11. Which property can be used to create rounded button corners?
    a) border-radius ✅
    b) border-curve
    c) radius
    d) round

  12. How can you make a font uppercase?
    a) font-transform: uppercase;
    b) text-transform: uppercase; ✅
    c) letter-transform: uppercase;
    d) capitalize

  13. Which of the following defines a grid layout?
    a) display: flex;
    b) display: grid; ✅
    c) display: block;
    d) display: table;

  14. Which property defines gaps between grid columns?
    a) grid-gap ✅
    b) column-gap
    c) grid-space
    d) grid-column-space

  15. The clip-path property is used for:
    a) Clipping an element shape ✅
    b) Setting background pattern
    c) Adding mask
    d) Cropping image

  16. Which property specifies shadow blur radius?
    a) shadow-blur
    b) box-shadow ✅
    c) shadow-radius
    d) blur

  17. What does position: relative; do?
    a) Positions element absolutely
    b) Positions relative to parent
    c) Positions relative to its normal location ✅
    d) Fixes to viewport

  18. Which pseudo-class targets every even row?
    a) :nth-child(odd)
    b) :nth-child(even) ✅
    c) :even
    d) :row(2n)

  19. Which property defines the space between borders and content?
    a) margin
    b) padding ✅
    c) border-spacing
    d) content-gap

  20. What does max-width control?
    a) Minimum width
    b) Maximum width ✅
    c) Height
    d) Border width

  21. Which CSS property defines the style of a border?
    a) border-style ✅
    b) border-width
    c) border-type
    d) border

  22. The cursor: pointer; property changes the cursor to:
    a) Hand icon ✅
    b) Arrow
    c) Text cursor
    d) None

  23. Which property changes element stacking order?
    a) order
    b) z-index ✅
    c) stack
    d) layer

  24. Which property changes text alignment vertically in a line box?
    a) vertical-align ✅
    b) line-align
    c) align-vertical
    d) text-vertical

  25. Which property can make an element transparent?
    a) transparency
    b) opacity ✅
    c) visibility
    d) clear

  26. Which CSS property defines an element’s outline?
    a) border
    b) outline ✅
    c) stroke
    d) edge

  27. Which value of position removes an element from the document flow?
    a) relative
    b) absolute ✅
    c) static
    d) fixed

  28. Which property changes the color of an underline?
    a) text-decoration-color ✅
    b) underline-color
    c) border-color
    d) font-color

  29. Which of these is NOT a display property value?
    a) inline-block
    b) grid
    c) float ✅
    d) inline

  30. Which CSS property defines the minimum height of an element?
    a) min-height ✅
    b) height-min
    c) min-size
    d) size

  31. Which CSS rule imports another stylesheet?
    a) @style
    b) @import ✅
    c) @load
    d) @use

  32. Which property adds space between table cells?
    a) cell-spacing
    b) border-spacing ✅
    c) table-gap
    d) grid-gap

  33. Which property sets how list items are marked?
    a) list-style ✅
    b) list-type
    c) bullet-type
    d) marker

  34. The default value of overflow is:
    a) hidden
    b) visible ✅
    c) auto
    d) scroll

  35. Which pseudo-class targets an element when clicked?
    a) :hover
    b) :focus
    c) :active ✅
    d) :visited

  36. Which property specifies how to align items vertically in flexbox?
    a) align-items ✅
    b) justify-content
    c) flex-align
    d) align-content

  37. What is the correct syntax for a linear gradient?
    a) background: gradient(linear, red, blue);
    b) background: linear-gradient(red, blue); ✅
    c) background: gradient(red, blue);
    d) background: color-gradient(red, blue);

  38. Which CSS property sets the space between grid rows?
    a) row-gap ✅
    b) grid-row
    c) grid-gap
    d) row-space

  39. Which property hides an element completely (no space)?
    a) visibility: hidden;
    b) display: none; ✅
    c) opacity: 0;
    d) none;

  40. Which CSS unit is relative to the parent’s font size?
    a) rem
    b) em ✅
    c) %
    d) vh

  41. What property defines the direction of flex items?
    a) flex-direction ✅
    b) justify-content
    c) flex-align
    d) flex-flow

  42. Which property creates transition effects?
    a) transition ✅
    b) transform
    c) animate
    d) delay

  43. The outline-offset property:
    a) Moves the outline away from the edge ✅
    b) Changes border spacing
    c) Adds padding
    d) Creates shadow

  44. Which property sets an image to cover the entire background area?
    a) background-fit: cover;
    b) background-size: cover; ✅
    c) background-scale: 100%;
    d) image-fit: cover;

  45. The object-fit property is used with:
    a) Images ✅
    b) Text
    c) Backgrounds
    d) Borders

  46. Which CSS feature makes websites responsive?
    a) Media Queries ✅
    b) Pseudo-classes
    c) Transitions
    d) Flexbox

  47. The transform property can:
    a) Rotate or scale elements ✅
    b) Animate colors
    c) Add shadows
    d) Create gradients

  48. Which value of justify-content centers flex items horizontally?
    a) center ✅
    b) middle
    c) justify
    d) flex-center

  49. Which value of align-items centers items vertically in flexbox?
    a) center ✅
    b) middle
    c) stretch
    d) baseline

  50. The transition-delay property specifies:
    a) How long the animation lasts
    b) When the transition starts ✅
    c) The type of transition
    d) The end state of animation

    1. Which property sets the spacing between table borders and content?
      a) border-spacing ✅
      b) cell-padding
      c) border-width
      d) padding

    2. What is the default value of flex-direction?
      a) column
      b) row ✅
      c) row-reverse
      d) column-reverse

    3. Which property defines how an element should float?
      a) align
      b) float ✅
      c) position
      d) display

    4. The clear property is used to:
      a) Remove background
      b) Control floating elements ✅
      c) Clear borders
      d) Remove padding

    5. The font-variant property is used to:
      a) Set bold
      b) Set small-caps ✅
      c) Set font color
      d) Set text-shadow

    6. Which property defines the space between columns in multi-column layout?
      a) column-gap ✅
      b) column-space
      c) grid-gap
      d) space-between

    7. What does the cursor: not-allowed; property do?
      a) Shows a red X
      b) Shows a “no” symbol ✅
      c) Hides the cursor
      d) Freezes cursor movement

    8. The list-style-type property is used to:
      a) Set bullet style ✅
      b) Set font size
      c) Set padding
      d) Set list direction

    9. The display: inline-block; property does what?
      a) Creates a block element
      b) Allows inline elements to have block properties ✅
      c) Hides elements
      d) Adds flex behavior

    10. Which CSS property can control how overflowing text is shown?
      a) text-overflow ✅
      b) overflow-text
      c) text-display
      d) clip-text

    11. What value of position keeps the element fixed within its container while scrolling?
      a) absolute
      b) sticky ✅
      c) relative
      d) fixed

    12. Which property specifies how white space is handled?
      a) space-mode
      b) white-space ✅
      c) spacing
      d) text-space

    13. Which property changes the capitalization of text?
      a) text-transform ✅
      b) font-transform
      c) case
      d) capitalize

    14. What is the correct syntax for adding a background gradient?
      a) background: gradient(linear, red, yellow);
      b) background: linear-gradient(red, yellow); ✅
      c) background-color: gradient(red, yellow);
      d) background-gradient: red, yellow;

    15. Which property defines how far the background image is from the left edge?
      a) background-position-x ✅
      b) background-x
      c) background-align
      d) bg-left

    16. Which property controls the order of items in grid layout?
      a) grid-order
      b) order ✅
      c) z-index
      d) arrange

    17. Which CSS function is used to rotate an element?
      a) rotate() ✅
      b) turn()
      c) spin()
      d) revolve()

    18. Which property adds rounded corners to a table?
      a) border-radius ✅
      b) table-radius
      c) round-table
      d) curve

    19. Which property is used to change the space between lines of text?
      a) line-spacing
      b) line-height ✅
      c) text-gap
      d) height

    20. Which shorthand property sets all margin values?
      a) margin ✅
      b) margin-all
      c) spacing
      d) padding

    21. Which CSS property controls the display order in stacking context?
      a) z-index ✅
      b) layer
      c) stack-order
      d) order

    22. Which function in CSS is used for color transparency?
      a) rgba() ✅
      b) rgb()
      c) alpha()
      d) color()

    23. Which property sets spacing between letters?
      a) letter-spacing ✅
      b) word-spacing
      c) font-spacing
      d) char-spacing

    24. Which property defines how elements are aligned in the last line of text?
      a) text-align-last ✅
      b) align-last
      c) text-justify
      d) justify-end

    25. What is the initial value of the z-index property?
      a) 1
      b) 0 ✅
      c) auto
      d) -1

    26. What does the :focus pseudo-class target?
      a) The element being hovered
      b) The element currently clicked
      c) The element that has input focus ✅
      d) The parent element

    27. Which CSS property defines how an element fits within its parent box?
      a) object-fit ✅
      b) background-fit
      c) image-fit
      d) box-fit

    28. Which property can change the indentation of a paragraph?
      a) text-indent ✅
      b) margin-left
      c) padding-left
      d) text-margin

    29. The resize property allows users to:
      a) Change font size
      b) Manually resize an element ✅
      c) Move elements
      d) Rotate elements

    30. Which property specifies how text is aligned in multi-column layout?
      a) column-align
      b) text-align ✅
      c) column-justify
      d) justify

    31. Which CSS property sets transparency of a background image?
      a) background-opacity
      b) opacity ✅
      c) image-alpha
      d) transparency

    32. The display: none; hides element and…
      a) Keeps its layout space
      b) Removes it from layout ✅
      c) Changes its z-index
      d) Hides only content

    33. Which property determines the visibility of table borders?
      a) border-collapse ✅
      b) table-border
      c) border-merge
      d) border-spacing

    34. Which CSS property defines how content fits into a container?
      a) object-fit ✅
      b) fit-content
      c) content-fit
      d) fit-object

    35. The outline property is similar to border, except:
      a) It does not take space ✅
      b) It adds padding
      c) It requires border-radius
      d) It changes shape

    36. Which property makes an element move horizontally or vertically?
      a) transform: translate(); ✅
      b) transform: move();
      c) position: slide();
      d) motion();

    37. Which function defines 3D rotation in CSS?
      a) rotate3d() ✅
      b) rotateZ()
      c) spin3d()
      d) revolve3d()

    38. The box-sizing property controls:
      a) How total size is calculated ✅
      b) The box border color
      c) The shape of box corners
      d) The box order

    39. Which property creates spacing between columns in text layout?
      a) column-gap ✅
      b) grid-gap
      c) column-space
      d) text-gap

    40. Which property defines how text overflows its container?
      a) text-overflow ✅
      b) overflow-text
      c) text-wrap
      d) overflow

    41. What does cursor: crosshair; show?
      a) Arrow
      b) Cross-shaped pointer ✅
      c) Hand
      d) Text cursor

    42. Which CSS property defines how an element transitions between states?
      a) transition ✅
      b) transform
      c) animation
      d) motion

    43. The word-break property:
      a) Wraps long words ✅
      b) Adds spaces
      c) Changes font spacing
      d) Sets letter case

    44. The text-align property aligns:
      a) Inline content ✅
      b) Block content
      c) Entire page
      d) Margins

    45. Which CSS property defines spacing around inline elements?
      a) margin ✅
      b) padding
      c) text-spacing
      d) spacing

    46. The overflow-y property controls:
      a) Horizontal overflow
      b) Vertical overflow ✅
      c) Both x and y
      d) Hidden overflow

    47. Which value of display makes elements behave as table rows?
      a) table-row ✅
      b) row
      c) table
      d) inline-table

    48. The min-width property sets:
      a) The smallest possible element width ✅
      b) The default width
      c) The largest width
      d) The minimum border

    49. The background-clip property controls:
      a) Background painting area ✅
      b) Image size
      c) Background color
      d) Border size

    50. Which property changes how a flex item grows relative to others?
      a) flex-grow ✅
      b) flex-shrink
      c) order
      d) align-items

      1. The max-height property sets:
        a) The largest allowed height ✅
        b) The smallest height
        c) The default height
        d) The initial height

      2. The float property can take which values?
        a) left, right, none ✅
        b) top, bottom, center
        c) inline, block
        d) up, down

      3. What does the clip-path property do?
        a) Clips an element to a shape ✅
        b) Cuts an image in half
        c) Creates borders
        d) Adds background gradients

      4. Which property is used to control the space between words?
        a) word-spacing ✅
        b) letter-spacing
        c) text-gap
        d) line-height

      5. Which property defines the shadow of an element’s box?
        a) box-shadow ✅
        b) text-shadow
        c) filter
        d) background-shadow

      6. Which pseudo-class targets links that have not been visited?
        a) :visited
        b) :link ✅
        c) :active
        d) :hover

      7. Which value of position removes the element from the document flow?
        a) absolute ✅
        b) relative
        c) static
        d) sticky

      8. Which property controls how images are resized to fit a container?
        a) object-fit ✅
        b) image-scale
        c) background-size
        d) fit-image

      9. The CSS property visibility: hidden; does what?
        a) Hides the element but keeps its space ✅
        b) Removes element completely
        c) Changes opacity to 0
        d) Makes text transparent

      10. The border-style property can have which value?
        a) dotted ✅
        b) thick
        c) 10px
        d) bright

      11. The @media rule is used for:
        a) Media queries ✅
        b) Importing fonts
        c) Adding audio
        d) Image filters

      12. The content property is used with:
        a) Pseudo-elements ✅
        b) Flexbox
        c) Tables
        d) Images

      13. The counter-increment property is related to:
        a) CSS counters ✅
        b) CSS animations
        c) CSS grids
        d) CSS columns

      14. Which property defines spacing between grid rows?
        a) row-gap ✅
        b) grid-spacing
        c) grid-gap
        d) row-space

      15. The transform-origin property defines:
        a) The point from which a transform is applied ✅
        b) The direction of gradient
        c) The rotation axis
        d) The animation start

      16. The CSS property overflow-x controls:
        a) Horizontal overflow ✅
        b) Vertical overflow
        c) Both axes
        d) Hidden overflow

      17. The CSS property cursor: pointer; changes the cursor to:
        a) Hand symbol ✅
        b) Arrow
        c) Crosshair
        d) Text

      18. The justify-content property aligns items:
        a) Horizontally in flexbox ✅
        b) Vertically
        c) Inside grid cells
        d) On the main axis only

      19. The align-items property controls alignment:
        a) On the cross axis ✅
        b) On the main axis
        c) Both axes
        d) Outside the container

      20. Which property changes the direction of flex items?
        a) flex-direction ✅
        b) flex-flow
        c) align-content
        d) justify-items

      21. The flex-wrap property allows:
        a) Items to wrap into multiple lines ✅
        b) Text to wrap around images
        c) Content to scroll
        d) Columns to stack

      22. Which shorthand property combines flex-direction and flex-wrap?
        a) flex-flow ✅
        b) flex-group
        c) flex-order
        d) flex-align

      23. Which property defines animation speed curve?
        a) animation-timing-function ✅
        b) animation-delay
        c) animation-duration
        d) animation-iteration-count

      24. The CSS property filter: blur(5px); applies:
        a) Blur effect ✅
        b) Grayscale effect
        c) Transparency
        d) Brightness

      25. The filter property can be used to apply:
        a) Visual effects like blur and brightness ✅
        b) Text spacing
        c) Layout alignment
        d) Borders

      26. The perspective property is used with:
        a) 3D transformations ✅
        b) Flexbox
        c) Transitions
        d) Grid

      27. The @keyframes rule is used for:
        a) Animations ✅
        b) Media queries
        c) Importing fonts
        d) Gradients

      28. Which CSS property defines the delay before an animation starts?
        a) animation-delay ✅
        b) animation-duration
        c) animation-iteration-count
        d) animation-fill-mode

      29. The transition-delay property defines:
        a) Wait time before transition starts ✅
        b) Transition duration
        c) Transition direction
        d) Transition speed

      30. The transition-property specifies:
        a) Which CSS property is affected ✅
        b) Transition color
        c) The total time
        d) The easing

      31. The transform: scale(2); doubles:
        a) The size ✅
        b) The position
        c) The border
        d) The opacity

      32. The CSS function translateY(50px) moves the element:
        a) 50px down ✅
        b) 50px right
        c) 50px left
        d) 50px up

      33. Which property makes elements appear above others visually?
        a) z-index ✅
        b) display
        c) position
        d) order

      34. Which value of position fixes an element relative to the viewport?
        a) fixed ✅
        b) sticky
        c) absolute
        d) relative

      35. Which property controls how child elements are spaced in a flex container?
        a) justify-content ✅
        b) flex-grow
        c) align-items
        d) display

      36. What does flex-basis define?
        a) Default size of flex item ✅
        b) Space between items
        c) Alignment direction
        d) Grow factor

      37. The grid-template-columns property defines:
        a) Number and size of columns ✅
        b) Row order
        c) Column spacing
        d) Grid gaps

      38. The grid-area property is used to:
        a) Assign an item to a named grid area ✅
        b) Define column size
        c) Add margin
        d) Add spacing

      39. The CSS function minmax(100px, 1fr) is used in:
        a) Grid layout ✅
        b) Flexbox
        c) Float layout
        d) Animation

      40. Which property sets how many columns a grid item spans?
        a) grid-column ✅
        b) grid-span
        c) column-span
        d) grid-width

      41. The grid-gap property is shorthand for:
        a) row-gap and column-gap ✅
        b) grid-spacing
        c) grid-align
        d) cell-padding

      42. Which property defines the alignment of grid content inside the container?
        a) justify-content ✅
        b) align-self
        c) grid-template
        d) place-items

      43. The place-items property combines:
        a) align-items and justify-items ✅
        b) order and direction
        c) grow and shrink
        d) gap and grid

      44. Which CSS property can change text color on hover?
        a) color ✅
        b) text-color
        c) background
        d) font-style

      45. The cursor: help; shows:
        a) A question mark ✅
        b) A hand symbol
        c) A cross
        d) A circle

      46. The scroll-behavior: smooth; property:
        a) Enables smooth scrolling ✅
        b) Stops scroll
        c) Adds parallax
        d) Inverts scroll

      47. The writing-mode property defines:
        a) Text direction ✅
        b) Font family
        c) Language
        d) Word spacing

      48. The column-count property specifies:
        a) Number of columns ✅
        b) Column spacing
        c) Column color
        d) Column width

      49. The counter-reset property:
        a) Initializes a CSS counter ✅
        b) Clears animations
        c) Resets layout
        d) Resets text

      50. The mix-blend-mode property controls:
        a) How colors blend with background ✅
        b) Font mixing
        c) Box blending
        d) Animation order

      51. 201. Which property is used to make a flex item shrink when needed?
        a) flex-shrink ✅
        b) flex-grow
        c) flex-basis
        d) justify-content

        1. The flex shorthand property combines:
          a) flex-grow, flex-shrink, flex-basis ✅
          b) flex-direction, flex-wrap
          c) align-items, justify-content
          d) order, gap

        2. What is the default value of flex-wrap?
          a) nowrap ✅
          b) wrap
          c) wrap-reverse
          d) initial

        3. The order property in flexbox controls:
          a) Display sequence of items ✅
          b) Alignment
          c) Item size
          d) Justification

        4. The align-self property:
          a) Overrides align-items for a single item ✅
          b) Sets global alignment
          c) Changes container direction
          d) Defines grow factor

        5. Which property is used to control spacing between grid items?
          a) gap ✅
          b) spacing
          c) margin
          d) padding

        6. The justify-items property in grid layout aligns items:
          a) Horizontally ✅
          b) Vertically
          c) Both
          d) Diagonally

        7. What does the auto-fit keyword do in grid templates?
          a) Adjusts columns to fit container width ✅
          b) Adds fixed columns
          c) Locks grid size
          d) Ignores item width

        8. The grid-template-rows property defines:
          a) Row size and count ✅
          b) Column width
          c) Grid area
          d) Item order

        9. Which CSS property defines how extra space is distributed in grid tracks?
          a) fr unit ✅
          b) px unit
          c) auto-fit
          d) percentage

        10. The grid-auto-flow property determines:
          a) How auto-placed items are inserted ✅
          b) The grid size
          c) The number of columns
          d) Alignment mode

        11. The place-content shorthand combines:
          a) align-content and justify-content ✅
          b) align-items and justify-items
          c) row-gap and column-gap
          d) grow and shrink

        12. Which property controls the transparency level?
          a) opacity ✅
          b) visibility
          c) transparency
          d) background-opacity

        13. What is the value of full opacity?
          a) 1 ✅
          b) 0
          c) 100%
          d) 10

        14. The text-shadow property requires at least how many values?
          a) 2 ✅ (horizontal and vertical offset)
          b) 1
          c) 3
          d) 4

        15. The background-attachment: fixed; property:
          a) Fixes background image in place ✅
          b) Scrolls with content
          c) Hides image
          d) Makes image repeat

        16. The CSS property background-size: cover; means:
          a) Image covers the element ✅
          b) Image repeats
          c) Image fits width only
          d) Image tiles

        17. Which value of background-repeat repeats image horizontally only?
          a) repeat-x ✅
          b) repeat-y
          c) repeat
          d) no-repeat

        18. The background-origin property defines:
          a) The positioning area for background image ✅
          b) The background color
          c) The clipping boundary
          d) The image size

        19. The clip property is used with:
          a) Absolutely positioned elements ✅
          b) Flex items
          c) Table cells
          d) Paragraphs

        20. The animation-fill-mode: forwards; means:
          a) The element stays in the final state ✅
          b) Animation repeats
          c) Animation reverses
          d) Animation restarts

        21. The animation-direction: alternate; means:
          a) Animation plays forward then backward ✅
          b) Animation loops
          c) Animation repeats
          d) Animation stops halfway

        22. The animation-iteration-count: infinite; means:
          a) Animation loops forever ✅
          b) Animation plays twice
          c) Animation stops after one cycle
          d) Animation reverses

        23. The :hover pseudo-class applies when:
          a) The mouse pointer is over an element ✅
          b) The element is clicked
          c) The element loads
          d) The element is focused

        24. The :nth-child(odd) selector targets:
          a) Odd-numbered elements ✅
          b) Even-numbered elements
          c) First child only
          d) Last child

        25. Which pseudo-class selects the first matching element?
          a) :first-of-type ✅
          b) :first-child
          c) :nth-of-type(1)
          d) :root

        26. The :not() pseudo-class is used for:
          a) Excluding specific elements ✅
          b) Including child elements
          c) Selecting all elements
          d) Resetting styles

        27. Which pseudo-element inserts content before an element?
          a) ::before ✅
          b) :before
          c) ::after
          d) :first

        28. The ::selection pseudo-element styles:
          a) Highlighted text ✅
          b) Links
          c) Inputs
          d) Borders

        29. The :root pseudo-class refers to:
          a) The <html> element ✅
          b) The <body> element
          c) The first child
          d) The parent element

        30. CSS variables are declared using:
          a) --variable-name
          b) $variable
          c) @variable
          d) var()

        31. To use a CSS variable, the syntax is:
          a) var(–variable-name) ✅
          b) $(variable-name)
          c) use(–variable-name)
          d) variable(–name)

        32. The calc() function allows:
          a) Arithmetic operations in CSS ✅
          b) Counting elements
          c) Measuring width
          d) Animation timing

        33. The @supports rule is used for:
          a) Checking browser support for properties ✅
          b) Importing fonts
          c) Adding media
          d) Linking stylesheets

        34. The @import rule is used to:
          a) Include other CSS files ✅
          b) Add JavaScript
          c) Load HTML templates
          d) Import media

        35. The @font-face rule allows:
          a) Custom fonts in CSS ✅
          b) Font embedding in HTML
          c) Linking JS fonts
          d) Web-safe fonts only

        36. The unicode-bidi property controls:
          a) Text direction in bidirectional text ✅
          b) Font size
          c) Background
          d) Alignment

        37. The direction: rtl; property makes text flow:
          a) Right to left ✅
          b) Left to right
          c) Top to bottom
          d) Bottom to top

        38. The resize: vertical; property allows resizing:
          a) Only vertically ✅
          b) Only horizontally
          c) Both directions
          d) No resizing

        39. The overflow: hidden; property:
          a) Hides content that exceeds the container ✅
          b) Shows scrollbars
          c) Expands the box
          d) Clips text

        40. The outline-offset property:
          a) Adds space between outline and element ✅
          b) Moves the border
          c) Changes margin
          d) Adjusts shadow

        41. The quotes property is used with:
          a) The <q> element ✅
          b) The <blockquote> tag
          c) The <span> tag
          d) The <cite> tag

        42. The tab-size property controls:
          a) Width of tab characters ✅
          b) Line spacing
          c) Paragraph indentation
          d) Margin size

        43. The scroll-margin property is used for:
          a) Scroll snapping ✅
          b) Margin between pages
          c) Scroll alignment
          d) Scroll visibility

        44. The scroll-snap-type property defines:
          a) How scrolling snaps to elements ✅
          b) Scroll speed
          c) Scroll behavior
          d) Scroll visibility

        45. The cursor: progress; indicates:
          a) Operation in progress ✅
          b) No permission
          c) Wait for input
          d) Text editable

        46. The pointer-events: none; property:
          a) Disables mouse interactions ✅
          b) Hides pointer
          c) Enables clicks
          d) Adds animations

        47. The user-select: none; property:
          a) Prevents text selection ✅
          b) Enables copy
          c) Changes cursor
          d) Locks input

        48. The isolation property creates:
          a) A new stacking context ✅
          b) Border isolation
          c) Visual filter
          d) Float area

        49. The all shorthand property resets:
          a) All CSS properties to initial or inherit ✅
          b) Only typography
          c) Only layout
          d) Only background

        1. The @media rule is used to:
          a) Apply styles for specific devices ✅
          b) Import other stylesheets
          c) Animate media elements
          d) Embed JavaScript

        2. Which syntax defines a media query for screen width below 768px?
          a) @media (max-width: 768px)
          b) @media screen < 768px
          c) @query width(768)
          d) @media-width(768px)

        3. The min-width condition in media queries means:
          a) Styles apply when viewport is at least that width ✅
          b) Styles apply when below that width
          c) Minimum height
          d) Always applies

        4. Which media type is used for printed documents?
          a) print ✅
          b) screen
          c) projection
          d) paper

        5. The orientation media feature detects:
          a) Screen orientation ✅
          b) Device type
          c) Font size
          d) Resolution

        6. The aspect-ratio media feature targets:
          a) Width-to-height ratio ✅
          b) Color depth
          c) Scroll direction
          d) Frame rate

        7. Which CSS property defines how elements respond to container size instead of viewport?
          a) container-type ✅
          b) media-type
          c) flex-wrap
          d) grid-auto-flow

        8. Which unit is relative to viewport width?
          a) vw ✅
          b) vh
          c) em
          d) rem

        9. Which unit is relative to the font size of the root element?
          a) rem ✅
          b) em
          c) vh
          d) vw

        10. The clamp() function sets:
          a) Min, preferred, and max values ✅
          b) Fixed values only
          c) Responsive scaling
          d) Font scaling only

        11. The @container rule is used for:
          a) Container queries ✅
          b) Flex layout
          c) Font importing
          d) Animation

        12. The font-display property controls:
          a) Font rendering behavior ✅
          b) Font size
          c) Font color
          d) Font family

        13. The font-smooth property is used to:
          a) Improve text rendering ✅
          b) Add shadows
          c) Set font size
          d) Stretch fonts

        14. The overflow-wrap property controls:
          a) Word breaking at the end of lines ✅
          b) Line spacing
          c) Margin collapse
          d) Flex wrapping

        15. The hyphens: auto; property enables:
          a) Automatic word hyphenation ✅
          b) Line spacing
          c) Paragraph indent
          d) Text transformation

        16. The backface-visibility property controls:
          a) Visibility of element’s back during 3D rotation ✅
          b) Opacity
          c) Shadow
          d) Border thickness

        17. The perspective-origin property defines:
          a) The vanishing point of 3D elements ✅
          b) The animation origin
          c) The transform base
          d) The flex direction

        18. The will-change property is used to:
          a) Optimize for expected property changes ✅
          b) Delay animations
          c) Add transitions
          d) Reset all properties

        19. The scrollbar-width property controls:
          a) The thickness of scrollbars ✅
          b) Scroll direction
          c) Scroll behavior
          d) Scroll color

        20. The accent-color property customizes:
          a) Checkboxes, radio buttons, etc. ✅
          b) Links
          c) Headings
          d) Images

        21. The caret-color property changes:
          a) The text cursor color ✅
          b) Font color
          c) Border
          d) Placeholder

        22. The ::placeholder pseudo-element styles:
          a) Placeholder text in inputs ✅
          b) Labels
          c) Default text
          d) Watermark

        23. The :checked pseudo-class targets:
          a) Selected checkboxes and radio buttons ✅
          b) Hovered links
          c) Disabled inputs
          d) Focused elements

        24. The :disabled pseudo-class applies to:
          a) Disabled form controls ✅
          b) Active buttons
          c) Hidden text
          d) Placeholder text

        25. The :empty pseudo-class selects elements that:
          a) Have no child nodes ✅
          b) Have empty attributes
          c) Are hidden
          d) Have display:none

        26. The :target pseudo-class styles:
          a) Elements matched by a fragment identifier ✅
          b) Inputs
          c) Hidden divs
          d) Focused text

        27. The :in-range pseudo-class applies to:
          a) Inputs whose value is within a specified range ✅
          b) Text fields
          c) Focused elements
          d) Hidden inputs

        28. The :out-of-range pseudo-class applies to:
          a) Inputs outside valid range ✅
          b) Inputs with default values
          c) Links
          d) Hovered buttons

        29. The :focus-visible pseudo-class:
          a) Applies focus styles when user interacts via keyboard ✅
          b) Applies focus to all inputs
          c) Hides outlines
          d) Disables tab focus

        30. The :has() pseudo-class allows:
          a) Selecting elements containing a specific descendant ✅
          b) Selecting siblings
          c) Selecting ancestors
          d) Selecting parents only

        31. The :where() pseudo-class provides:
          a) Low-specificity grouping of selectors ✅
          b) ID targeting
          c) Color filtering
          d) Value mapping

        32. The :is() pseudo-class allows:
          a) Matching multiple selectors ✅
          b) Inverting selections
          c) Filtering attributes
          d) Styling pseudo-elements

        33. The @layer rule is used for:
          a) Layered style organization ✅
          b) CSS filters
          c) Font imports
          d) Animations

        34. The ::backdrop pseudo-element styles:
          a) Background behind modals or dialogs ✅
          b) Background images
          c) Popovers
          d) Scroll areas

        35. The display: contents; property:
          a) Removes box but keeps children visible ✅
          b) Hides element
          c) Displays as flex
          d) Wraps content

        36. The object-position property controls:
          a) Image alignment inside container ✅
          b) Object size
          c) Border alignment
          d) Background fit

        37. The clip-path: circle(); property creates:
          a) Circular shape clipping ✅
          b) Border radius
          c) Box shadow
          d) Mask

        38. The mask-image property:
          a) Defines an image used as a mask ✅
          b) Adds shadow
          c) Adds gradient
          d) Applies border

        39. The filter: grayscale(100%); property makes:
          a) Image black and white ✅
          b) Transparent
          c) Blurred
          d) Colored

        40. The filter: brightness(150%); property:
          a) Increases image brightness ✅
          b) Darkens image
          c) Adds contrast
          d) Desaturates

        41. The backdrop-filter property applies effects:
          a) Behind an element ✅
          b) To text
          c) To borders
          d) To child elements

        42. The mix-blend-mode: multiply; creates:
          a) Color blending like Photoshop multiply ✅
          b) Overlay color
          c) Normal blend
          d) Screen blend

        43. The scroll-snap-align property controls:
          a) Snap position of elements ✅
          b) Scroll direction
          c) Scroll overflow
          d) Scroll padding

        44. The writing-mode: vertical-rl; property makes text flow:
          a) Vertically from right to left ✅
          b) Vertically from left to right
          c) Horizontally
          d) Upside-down

        45. The text-orientation: upright; property is used in:
          a) Vertical writing modes ✅
          b) Flex containers
          c) Grid layouts
          d) Responsive design

        46. The line-clamp property:
          a) Limits number of visible text lines ✅
          b) Adds ellipsis
          c) Controls paragraph width
          d) Justifies text

        47. The :first-letter pseudo-element styles:
          a) The first letter of a text block ✅
          b) The first word
          c) The first sentence
          d) The title

        48. The :first-line pseudo-element affects:
          a) The first line of text ✅
          b) The heading
          c) The footer
          d) The body

        49. The ::marker pseudo-element styles:
          a) List item markers ✅
          b) Paragraphs
          c) Input icons
          d) Links

        50. The @keyframes bounce defines:
          a) A named animation sequence ✅
          b) A gradient pattern
          c) A flex property
          d) A grid template

You cannot copy content of this page

Scroll to Top