CSS MCQs
What does CSS stand for?
a) Creative Style Sheets
b) Cascading Style Sheets ✅
c) Computer Style Sheets
d) Colorful Style SheetsWhich HTML tag is used to link an external CSS file?
a)<style>
b)<link>✅
c)<css>
d)<stylesheet>Which property is used to change the background color?
a) color
b) background-color ✅
c) bg-color
d) bgcolorWhich of the following is the correct CSS syntax?
a) body:color=black;
b) {body:color=black;}
c) body {color: black;} ✅
d) {body;color:black;}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>Which symbol is used for ID selector in CSS?
a) .
b) # ✅
c) *
d) @Which symbol is used for class selector in CSS?
a) *
b) . ✅
c) #
d) %What is the default value of the position property?
a) fixed
b) absolute
c) relative
d) static ✅Which property is used to change text color?
a) font-color
b) text-color
c) color ✅
d) background-colorWhich property is used to make text bold?
a) font-weight ✅
b) font-style
c) font-decoration
d) font-boldWhat is the correct syntax to comment in CSS?
a) <!– comment –>
b) // comment //
c) /* comment */ ✅
d) # commentWhich property controls the size of text?
a) text-size
b) font-size ✅
c) font-style
d) sizeHow do you select all
<p>elements inside a<div>?
a) div p ✅
b) div+p
c) div.p
d) div#pWhich property is used to set space between letters?
a) letter-spacing ✅
b) word-spacing
c) text-spacing
d) spacingThe CSS property used to underline text is:
a) text-line
b) underline
c) text-decoration ✅
d) font-decorationWhich property is used to align text to the center?
a) text-align ✅
b) align
c) font-align
d) centerHow do you apply a style to all
<h1>elements?
a) .h1 {}
b) #h1 {}
c) h1 {} ✅
d) heading {}Which property controls the left margin of an element?
a) margin-left ✅
b) padding-left
c) space-left
d) left-marginHow can you make a list display horizontally?
a) list-direction: horizontal;
b) display: inline; ✅
c) float: left;
d) display: block;Which property is used to set the space between lines?
a) line-spacing
b) line-height ✅
c) spacing
d) text-heightWhich value of
displayhides an element but keeps space?
a) hidden
b) none
c) visibility: hidden ✅
d) display: invisibleWhat does the
z-indexproperty control?
a) Transparency
b) Layer order ✅
c) Font size
d) PositionWhich property adds space inside an element?
a) margin
b) padding ✅
c) spacing
d) borderWhich property adds space outside an element?
a) margin ✅
b) padding
c) spacing
d) borderThe
floatproperty can take which value?
a) left ✅
b) top
c) middle
d) centerWhat does
overflow: hidden;do?
a) Hides overflow content ✅
b) Displays overflow
c) Wraps text
d) Clips only horizontallyWhich unit is relative to the root element font size?
a) em
b) rem ✅
c) px
d) %Which CSS property defines shadow around text?
a) text-shadow ✅
b) box-shadow
c) shadow
d) font-shadowHow to make a border dashed?
a) border-type: dashed;
b) border-style: dashed; ✅
c) border-line: dashed;
d) border-dash: true;Which of these properties can center a block element?
a) margin: auto; ✅
b) align: center;
c) padding: auto;
d) float: center;Which property changes the shape of the mouse cursor?
a) pointer-type
b) cursor ✅
c) mouse
d) hoverThe
border-radiusproperty is used to:
a) Add shadow
b) Round corners ✅
c) Create borders
d) Add paddingWhich property controls element transparency?
a) visibility
b) opacity ✅
c) alpha
d) colorHow to select elements with both class “a” and “b”?
a) .a, .b
b) .a.b ✅
c) a.b
d) a,bWhich pseudo-class targets the first child of a parent?
a) :child
b) :first-child ✅
c) :first
d) :nthWhich property controls animation speed curve?
a) animation-delay
b) animation-timing-function ✅
c) animation-curve
d) animation-paceWhich property specifies transition duration?
a) transition-time
b) transition-delay
c) transition-duration ✅
d) durationWhich property sets the layout direction in flexbox?
a) flex-direction ✅
b) flex-flow
c) flex-align
d) justify-directionWhat does
display: flex;do?
a) Creates a grid
b) Creates a flex container ✅
c) Centers elements
d) Hides elementWhich property aligns items along the main axis?
a) justify-content ✅
b) align-items
c) flex-align
d) align-contentWhich value of position fixes an element relative to viewport?
a) fixed ✅
b) absolute
c) relative
d) staticWhich property defines the height of an element?
a) element-height
b) height ✅
c) size
d) block-heightWhat property can control element visibility?
a) visible
b) display
c) visibility ✅
d) showWhich value of
displaycreates an inline container?
a) inline ✅
b) block
c) flex
d) tableWhich property changes the order of flex items?
a) flex-order
b) order ✅
c) flex-index
d) sortWhich property is used for responsive breakpoints?
a) @screen
b) @media ✅
c) @device
d) @queryWhich property adds a shadow around boxes?
a) box-shadow ✅
b) border-shadow
c) element-shadow
d) shadowWhich CSS feature supports custom properties?
a) Variables ✅
b) Mixins
c) Constants
d) TokensWhich property controls how background repeats?
a) background-repeat ✅
b) repeat
c) bg-repeat
d) background-loopWhich color format supports alpha transparency?
a) RGB
b) HEX
c) RGBA ✅
d) HSL
Which property controls the width of an element’s border?
a) border-size
b) border-width ✅
c) border-style
d) border-spacingWhich of the following is NOT a valid CSS unit?
a) px
b) em
c) pt
d) gm ✅How do you make text italic in CSS?
a) font-variant: italic;
b) font-style: italic; ✅
c) text-style: italic;
d) text-decoration: italic;The
:hoverpseudo-class is used for:
a) Clicking an element
b) Focusing on an element
c) When the mouse is over an element ✅
d) Selecting an elementWhat is the default display property for
<span>?
a) inline ✅
b) block
c) flex
d) noneWhich property changes the background image of an element?
a) background-img
b) background-image ✅
c) bg-image
d) imageThe
@font-facerule is used to:
a) Include custom fonts ✅
b) Add icons
c) Create transitions
d) Define gradientsWhich property defines space between words?
a) word-spacing ✅
b) letter-spacing
c) line-spacing
d) text-indentWhich property defines how the background image is positioned?
a) background-position ✅
b) image-position
c) position
d) bg-alignWhat value of
overflowwill add scrollbars?
a) auto ✅
b) hidden
c) visible
d) noneWhich property can be used to create rounded button corners?
a) border-radius ✅
b) border-curve
c) radius
d) roundHow can you make a font uppercase?
a) font-transform: uppercase;
b) text-transform: uppercase; ✅
c) letter-transform: uppercase;
d) capitalizeWhich of the following defines a grid layout?
a) display: flex;
b) display: grid; ✅
c) display: block;
d) display: table;Which property defines gaps between grid columns?
a) grid-gap ✅
b) column-gap
c) grid-space
d) grid-column-spaceThe
clip-pathproperty is used for:
a) Clipping an element shape ✅
b) Setting background pattern
c) Adding mask
d) Cropping imageWhich property specifies shadow blur radius?
a) shadow-blur
b) box-shadow ✅
c) shadow-radius
d) blurWhat does
position: relative;do?
a) Positions element absolutely
b) Positions relative to parent
c) Positions relative to its normal location ✅
d) Fixes to viewportWhich pseudo-class targets every even row?
a) :nth-child(odd)
b) :nth-child(even) ✅
c) :even
d) :row(2n)Which property defines the space between borders and content?
a) margin
b) padding ✅
c) border-spacing
d) content-gapWhat does
max-widthcontrol?
a) Minimum width
b) Maximum width ✅
c) Height
d) Border widthWhich CSS property defines the style of a border?
a) border-style ✅
b) border-width
c) border-type
d) borderThe
cursor: pointer;property changes the cursor to:
a) Hand icon ✅
b) Arrow
c) Text cursor
d) NoneWhich property changes element stacking order?
a) order
b) z-index ✅
c) stack
d) layerWhich property changes text alignment vertically in a line box?
a) vertical-align ✅
b) line-align
c) align-vertical
d) text-verticalWhich property can make an element transparent?
a) transparency
b) opacity ✅
c) visibility
d) clearWhich CSS property defines an element’s outline?
a) border
b) outline ✅
c) stroke
d) edgeWhich value of
positionremoves an element from the document flow?
a) relative
b) absolute ✅
c) static
d) fixedWhich property changes the color of an underline?
a) text-decoration-color ✅
b) underline-color
c) border-color
d) font-colorWhich of these is NOT a display property value?
a) inline-block
b) grid
c) float ✅
d) inlineWhich CSS property defines the minimum height of an element?
a) min-height ✅
b) height-min
c) min-size
d) sizeWhich CSS rule imports another stylesheet?
a) @style
b) @import ✅
c) @load
d) @useWhich property adds space between table cells?
a) cell-spacing
b) border-spacing ✅
c) table-gap
d) grid-gapWhich property sets how list items are marked?
a) list-style ✅
b) list-type
c) bullet-type
d) markerThe default value of
overflowis:
a) hidden
b) visible ✅
c) auto
d) scrollWhich pseudo-class targets an element when clicked?
a) :hover
b) :focus
c) :active ✅
d) :visitedWhich property specifies how to align items vertically in flexbox?
a) align-items ✅
b) justify-content
c) flex-align
d) align-contentWhat 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);Which CSS property sets the space between grid rows?
a) row-gap ✅
b) grid-row
c) grid-gap
d) row-spaceWhich property hides an element completely (no space)?
a) visibility: hidden;
b) display: none; ✅
c) opacity: 0;
d) none;Which CSS unit is relative to the parent’s font size?
a) rem
b) em ✅
c) %
d) vhWhat property defines the direction of flex items?
a) flex-direction ✅
b) justify-content
c) flex-align
d) flex-flowWhich property creates transition effects?
a) transition ✅
b) transform
c) animate
d) delayThe
outline-offsetproperty:
a) Moves the outline away from the edge ✅
b) Changes border spacing
c) Adds padding
d) Creates shadowWhich 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;The
object-fitproperty is used with:
a) Images ✅
b) Text
c) Backgrounds
d) BordersWhich CSS feature makes websites responsive?
a) Media Queries ✅
b) Pseudo-classes
c) Transitions
d) FlexboxThe
transformproperty can:
a) Rotate or scale elements ✅
b) Animate colors
c) Add shadows
d) Create gradientsWhich value of
justify-contentcenters flex items horizontally?
a) center ✅
b) middle
c) justify
d) flex-centerWhich value of
align-itemscenters items vertically in flexbox?
a) center ✅
b) middle
c) stretch
d) baselineThe
transition-delayproperty specifies:
a) How long the animation lasts
b) When the transition starts ✅
c) The type of transition
d) The end state of animationWhich property sets the spacing between table borders and content?
a) border-spacing ✅
b) cell-padding
c) border-width
d) paddingWhat is the default value of
flex-direction?
a) column
b) row ✅
c) row-reverse
d) column-reverseWhich property defines how an element should float?
a) align
b) float ✅
c) position
d) displayThe
clearproperty is used to:
a) Remove background
b) Control floating elements ✅
c) Clear borders
d) Remove paddingThe
font-variantproperty is used to:
a) Set bold
b) Set small-caps ✅
c) Set font color
d) Set text-shadowWhich property defines the space between columns in multi-column layout?
a) column-gap ✅
b) column-space
c) grid-gap
d) space-betweenWhat does the
cursor: not-allowed;property do?
a) Shows a red X
b) Shows a “no” symbol ✅
c) Hides the cursor
d) Freezes cursor movementThe
list-style-typeproperty is used to:
a) Set bullet style ✅
b) Set font size
c) Set padding
d) Set list directionThe
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 behaviorWhich CSS property can control how overflowing text is shown?
a) text-overflow ✅
b) overflow-text
c) text-display
d) clip-textWhat value of
positionkeeps the element fixed within its container while scrolling?
a) absolute
b) sticky ✅
c) relative
d) fixedWhich property specifies how white space is handled?
a) space-mode
b) white-space ✅
c) spacing
d) text-spaceWhich property changes the capitalization of text?
a) text-transform ✅
b) font-transform
c) case
d) capitalizeWhat 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;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-leftWhich property controls the order of items in grid layout?
a) grid-order
b) order ✅
c) z-index
d) arrangeWhich CSS function is used to rotate an element?
a) rotate() ✅
b) turn()
c) spin()
d) revolve()Which property adds rounded corners to a table?
a) border-radius ✅
b) table-radius
c) round-table
d) curveWhich property is used to change the space between lines of text?
a) line-spacing
b) line-height ✅
c) text-gap
d) heightWhich shorthand property sets all margin values?
a) margin ✅
b) margin-all
c) spacing
d) paddingWhich CSS property controls the display order in stacking context?
a) z-index ✅
b) layer
c) stack-order
d) orderWhich function in CSS is used for color transparency?
a) rgba() ✅
b) rgb()
c) alpha()
d) color()Which property sets spacing between letters?
a) letter-spacing ✅
b) word-spacing
c) font-spacing
d) char-spacingWhich property defines how elements are aligned in the last line of text?
a) text-align-last ✅
b) align-last
c) text-justify
d) justify-endWhat is the initial value of the
z-indexproperty?
a) 1
b) 0 ✅
c) auto
d) -1What does the
:focuspseudo-class target?
a) The element being hovered
b) The element currently clicked
c) The element that has input focus ✅
d) The parent elementWhich CSS property defines how an element fits within its parent box?
a) object-fit ✅
b) background-fit
c) image-fit
d) box-fitWhich property can change the indentation of a paragraph?
a) text-indent ✅
b) margin-left
c) padding-left
d) text-marginThe
resizeproperty allows users to:
a) Change font size
b) Manually resize an element ✅
c) Move elements
d) Rotate elementsWhich property specifies how text is aligned in multi-column layout?
a) column-align
b) text-align ✅
c) column-justify
d) justifyWhich CSS property sets transparency of a background image?
a) background-opacity
b) opacity ✅
c) image-alpha
d) transparencyThe
display: none;hides element and…
a) Keeps its layout space
b) Removes it from layout ✅
c) Changes its z-index
d) Hides only contentWhich property determines the visibility of table borders?
a) border-collapse ✅
b) table-border
c) border-merge
d) border-spacingWhich CSS property defines how content fits into a container?
a) object-fit ✅
b) fit-content
c) content-fit
d) fit-objectThe
outlineproperty is similar to border, except:
a) It does not take space ✅
b) It adds padding
c) It requires border-radius
d) It changes shapeWhich property makes an element move horizontally or vertically?
a) transform: translate(); ✅
b) transform: move();
c) position: slide();
d) motion();Which function defines 3D rotation in CSS?
a) rotate3d() ✅
b) rotateZ()
c) spin3d()
d) revolve3d()The
box-sizingproperty controls:
a) How total size is calculated ✅
b) The box border color
c) The shape of box corners
d) The box orderWhich property creates spacing between columns in text layout?
a) column-gap ✅
b) grid-gap
c) column-space
d) text-gapWhich property defines how text overflows its container?
a) text-overflow ✅
b) overflow-text
c) text-wrap
d) overflowWhat does
cursor: crosshair;show?
a) Arrow
b) Cross-shaped pointer ✅
c) Hand
d) Text cursorWhich CSS property defines how an element transitions between states?
a) transition ✅
b) transform
c) animation
d) motionThe
word-breakproperty:
a) Wraps long words ✅
b) Adds spaces
c) Changes font spacing
d) Sets letter caseThe
text-alignproperty aligns:
a) Inline content ✅
b) Block content
c) Entire page
d) MarginsWhich CSS property defines spacing around inline elements?
a) margin ✅
b) padding
c) text-spacing
d) spacingThe
overflow-yproperty controls:
a) Horizontal overflow
b) Vertical overflow ✅
c) Both x and y
d) Hidden overflowWhich value of
displaymakes elements behave as table rows?
a) table-row ✅
b) row
c) table
d) inline-tableThe
min-widthproperty sets:
a) The smallest possible element width ✅
b) The default width
c) The largest width
d) The minimum borderThe
background-clipproperty controls:
a) Background painting area ✅
b) Image size
c) Background color
d) Border sizeWhich property changes how a flex item grows relative to others?
a) flex-grow ✅
b) flex-shrink
c) order
d) align-itemsThe
max-heightproperty sets:
a) The largest allowed height ✅
b) The smallest height
c) The default height
d) The initial heightThe
floatproperty can take which values?
a) left, right, none ✅
b) top, bottom, center
c) inline, block
d) up, downWhat does the
clip-pathproperty do?
a) Clips an element to a shape ✅
b) Cuts an image in half
c) Creates borders
d) Adds background gradientsWhich property is used to control the space between words?
a) word-spacing ✅
b) letter-spacing
c) text-gap
d) line-heightWhich property defines the shadow of an element’s box?
a) box-shadow ✅
b) text-shadow
c) filter
d) background-shadowWhich pseudo-class targets links that have not been visited?
a) :visited
b) :link ✅
c) :active
d) :hoverWhich value of
positionremoves the element from the document flow?
a) absolute ✅
b) relative
c) static
d) stickyWhich property controls how images are resized to fit a container?
a) object-fit ✅
b) image-scale
c) background-size
d) fit-imageThe 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 transparentThe
border-styleproperty can have which value?
a) dotted ✅
b) thick
c) 10px
d) brightThe
@mediarule is used for:
a) Media queries ✅
b) Importing fonts
c) Adding audio
d) Image filtersThe
contentproperty is used with:
a) Pseudo-elements ✅
b) Flexbox
c) Tables
d) ImagesThe
counter-incrementproperty is related to:
a) CSS counters ✅
b) CSS animations
c) CSS grids
d) CSS columnsWhich property defines spacing between grid rows?
a) row-gap ✅
b) grid-spacing
c) grid-gap
d) row-spaceThe
transform-originproperty defines:
a) The point from which a transform is applied ✅
b) The direction of gradient
c) The rotation axis
d) The animation startThe CSS property
overflow-xcontrols:
a) Horizontal overflow ✅
b) Vertical overflow
c) Both axes
d) Hidden overflowThe CSS property
cursor: pointer;changes the cursor to:
a) Hand symbol ✅
b) Arrow
c) Crosshair
d) TextThe
justify-contentproperty aligns items:
a) Horizontally in flexbox ✅
b) Vertically
c) Inside grid cells
d) On the main axis onlyThe
align-itemsproperty controls alignment:
a) On the cross axis ✅
b) On the main axis
c) Both axes
d) Outside the containerWhich property changes the direction of flex items?
a) flex-direction ✅
b) flex-flow
c) align-content
d) justify-itemsThe
flex-wrapproperty allows:
a) Items to wrap into multiple lines ✅
b) Text to wrap around images
c) Content to scroll
d) Columns to stackWhich shorthand property combines flex-direction and flex-wrap?
a) flex-flow ✅
b) flex-group
c) flex-order
d) flex-alignWhich property defines animation speed curve?
a) animation-timing-function ✅
b) animation-delay
c) animation-duration
d) animation-iteration-countThe CSS property
filter: blur(5px);applies:
a) Blur effect ✅
b) Grayscale effect
c) Transparency
d) BrightnessThe
filterproperty can be used to apply:
a) Visual effects like blur and brightness ✅
b) Text spacing
c) Layout alignment
d) BordersThe
perspectiveproperty is used with:
a) 3D transformations ✅
b) Flexbox
c) Transitions
d) GridThe
@keyframesrule is used for:
a) Animations ✅
b) Media queries
c) Importing fonts
d) GradientsWhich CSS property defines the delay before an animation starts?
a) animation-delay ✅
b) animation-duration
c) animation-iteration-count
d) animation-fill-modeThe
transition-delayproperty defines:
a) Wait time before transition starts ✅
b) Transition duration
c) Transition direction
d) Transition speedThe
transition-propertyspecifies:
a) Which CSS property is affected ✅
b) Transition color
c) The total time
d) The easingThe
transform: scale(2);doubles:
a) The size ✅
b) The position
c) The border
d) The opacityThe CSS function
translateY(50px)moves the element:
a) 50px down ✅
b) 50px right
c) 50px left
d) 50px upWhich property makes elements appear above others visually?
a) z-index ✅
b) display
c) position
d) orderWhich value of
positionfixes an element relative to the viewport?
a) fixed ✅
b) sticky
c) absolute
d) relativeWhich property controls how child elements are spaced in a flex container?
a) justify-content ✅
b) flex-grow
c) align-items
d) displayWhat does
flex-basisdefine?
a) Default size of flex item ✅
b) Space between items
c) Alignment direction
d) Grow factorThe
grid-template-columnsproperty defines:
a) Number and size of columns ✅
b) Row order
c) Column spacing
d) Grid gapsThe
grid-areaproperty is used to:
a) Assign an item to a named grid area ✅
b) Define column size
c) Add margin
d) Add spacingThe CSS function
minmax(100px, 1fr)is used in:
a) Grid layout ✅
b) Flexbox
c) Float layout
d) AnimationWhich property sets how many columns a grid item spans?
a) grid-column ✅
b) grid-span
c) column-span
d) grid-widthThe
grid-gapproperty is shorthand for:
a) row-gap and column-gap ✅
b) grid-spacing
c) grid-align
d) cell-paddingWhich property defines the alignment of grid content inside the container?
a) justify-content ✅
b) align-self
c) grid-template
d) place-itemsThe
place-itemsproperty combines:
a) align-items and justify-items ✅
b) order and direction
c) grow and shrink
d) gap and gridWhich CSS property can change text color on hover?
a) color ✅
b) text-color
c) background
d) font-styleThe
cursor: help;shows:
a) A question mark ✅
b) A hand symbol
c) A cross
d) A circleThe
scroll-behavior: smooth;property:
a) Enables smooth scrolling ✅
b) Stops scroll
c) Adds parallax
d) Inverts scrollThe
writing-modeproperty defines:
a) Text direction ✅
b) Font family
c) Language
d) Word spacingThe
column-countproperty specifies:
a) Number of columns ✅
b) Column spacing
c) Column color
d) Column widthThe
counter-resetproperty:
a) Initializes a CSS counter ✅
b) Clears animations
c) Resets layout
d) Resets textThe
mix-blend-modeproperty controls:
a) How colors blend with background ✅
b) Font mixing
c) Box blending
d) Animation order201. Which property is used to make a flex item shrink when needed?
a) flex-shrink ✅
b) flex-grow
c) flex-basis
d) justify-contentThe
flexshorthand property combines:
a) flex-grow, flex-shrink, flex-basis ✅
b) flex-direction, flex-wrap
c) align-items, justify-content
d) order, gapWhat is the default value of
flex-wrap?
a) nowrap ✅
b) wrap
c) wrap-reverse
d) initialThe
orderproperty in flexbox controls:
a) Display sequence of items ✅
b) Alignment
c) Item size
d) JustificationThe
align-selfproperty:
a) Overrides align-items for a single item ✅
b) Sets global alignment
c) Changes container direction
d) Defines grow factorWhich property is used to control spacing between grid items?
a) gap ✅
b) spacing
c) margin
d) paddingThe
justify-itemsproperty in grid layout aligns items:
a) Horizontally ✅
b) Vertically
c) Both
d) DiagonallyWhat does the
auto-fitkeyword do in grid templates?
a) Adjusts columns to fit container width ✅
b) Adds fixed columns
c) Locks grid size
d) Ignores item widthThe
grid-template-rowsproperty defines:
a) Row size and count ✅
b) Column width
c) Grid area
d) Item orderWhich CSS property defines how extra space is distributed in grid tracks?
a) fr unit ✅
b) px unit
c) auto-fit
d) percentageThe
grid-auto-flowproperty determines:
a) How auto-placed items are inserted ✅
b) The grid size
c) The number of columns
d) Alignment modeThe
place-contentshorthand combines:
a) align-content and justify-content ✅
b) align-items and justify-items
c) row-gap and column-gap
d) grow and shrinkWhich property controls the transparency level?
a) opacity ✅
b) visibility
c) transparency
d) background-opacityWhat is the value of full opacity?
a) 1 ✅
b) 0
c) 100%
d) 10The
text-shadowproperty requires at least how many values?
a) 2 ✅ (horizontal and vertical offset)
b) 1
c) 3
d) 4The
background-attachment: fixed;property:
a) Fixes background image in place ✅
b) Scrolls with content
c) Hides image
d) Makes image repeatThe CSS property
background-size: cover;means:
a) Image covers the element ✅
b) Image repeats
c) Image fits width only
d) Image tilesWhich value of
background-repeatrepeats image horizontally only?
a) repeat-x ✅
b) repeat-y
c) repeat
d) no-repeatThe
background-originproperty defines:
a) The positioning area for background image ✅
b) The background color
c) The clipping boundary
d) The image sizeThe
clipproperty is used with:
a) Absolutely positioned elements ✅
b) Flex items
c) Table cells
d) ParagraphsThe
animation-fill-mode: forwards;means:
a) The element stays in the final state ✅
b) Animation repeats
c) Animation reverses
d) Animation restartsThe
animation-direction: alternate;means:
a) Animation plays forward then backward ✅
b) Animation loops
c) Animation repeats
d) Animation stops halfwayThe
animation-iteration-count: infinite;means:
a) Animation loops forever ✅
b) Animation plays twice
c) Animation stops after one cycle
d) Animation reversesThe
:hoverpseudo-class applies when:
a) The mouse pointer is over an element ✅
b) The element is clicked
c) The element loads
d) The element is focusedThe
:nth-child(odd)selector targets:
a) Odd-numbered elements ✅
b) Even-numbered elements
c) First child only
d) Last childWhich pseudo-class selects the first matching element?
a) :first-of-type ✅
b) :first-child
c) :nth-of-type(1)
d) :rootThe
:not()pseudo-class is used for:
a) Excluding specific elements ✅
b) Including child elements
c) Selecting all elements
d) Resetting stylesWhich pseudo-element inserts content before an element?
a) ::before ✅
b) :before
c) ::after
d) :firstThe
::selectionpseudo-element styles:
a) Highlighted text ✅
b) Links
c) Inputs
d) BordersThe
:rootpseudo-class refers to:
a) The<html>element ✅
b) The<body>element
c) The first child
d) The parent elementCSS variables are declared using:
a)--variable-name✅
b)$variable
c)@variable
d)var()To use a CSS variable, the syntax is:
a) var(–variable-name) ✅
b) $(variable-name)
c) use(–variable-name)
d) variable(–name)The
calc()function allows:
a) Arithmetic operations in CSS ✅
b) Counting elements
c) Measuring width
d) Animation timingThe
@supportsrule is used for:
a) Checking browser support for properties ✅
b) Importing fonts
c) Adding media
d) Linking stylesheetsThe
@importrule is used to:
a) Include other CSS files ✅
b) Add JavaScript
c) Load HTML templates
d) Import mediaThe
@font-facerule allows:
a) Custom fonts in CSS ✅
b) Font embedding in HTML
c) Linking JS fonts
d) Web-safe fonts onlyThe
unicode-bidiproperty controls:
a) Text direction in bidirectional text ✅
b) Font size
c) Background
d) AlignmentThe
direction: rtl;property makes text flow:
a) Right to left ✅
b) Left to right
c) Top to bottom
d) Bottom to topThe
resize: vertical;property allows resizing:
a) Only vertically ✅
b) Only horizontally
c) Both directions
d) No resizingThe
overflow: hidden;property:
a) Hides content that exceeds the container ✅
b) Shows scrollbars
c) Expands the box
d) Clips textThe
outline-offsetproperty:
a) Adds space between outline and element ✅
b) Moves the border
c) Changes margin
d) Adjusts shadowThe
quotesproperty is used with:
a) The<q>element ✅
b) The<blockquote>tag
c) The<span>tag
d) The<cite>tagThe
tab-sizeproperty controls:
a) Width of tab characters ✅
b) Line spacing
c) Paragraph indentation
d) Margin sizeThe
scroll-marginproperty is used for:
a) Scroll snapping ✅
b) Margin between pages
c) Scroll alignment
d) Scroll visibilityThe
scroll-snap-typeproperty defines:
a) How scrolling snaps to elements ✅
b) Scroll speed
c) Scroll behavior
d) Scroll visibilityThe
cursor: progress;indicates:
a) Operation in progress ✅
b) No permission
c) Wait for input
d) Text editableThe
pointer-events: none;property:
a) Disables mouse interactions ✅
b) Hides pointer
c) Enables clicks
d) Adds animationsThe
user-select: none;property:
a) Prevents text selection ✅
b) Enables copy
c) Changes cursor
d) Locks inputThe
isolationproperty creates:
a) A new stacking context ✅
b) Border isolation
c) Visual filter
d) Float areaThe
allshorthand property resets:
a) All CSS properties to initial or inherit ✅
b) Only typography
c) Only layout
d) Only background
The
@mediarule is used to:
a) Apply styles for specific devices ✅
b) Import other stylesheets
c) Animate media elements
d) Embed JavaScriptWhich 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)The
min-widthcondition 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 appliesWhich media type is used for printed documents?
a) print ✅
b) screen
c) projection
d) paperThe
orientationmedia feature detects:
a) Screen orientation ✅
b) Device type
c) Font size
d) ResolutionThe
aspect-ratiomedia feature targets:
a) Width-to-height ratio ✅
b) Color depth
c) Scroll direction
d) Frame rateWhich CSS property defines how elements respond to container size instead of viewport?
a) container-type ✅
b) media-type
c) flex-wrap
d) grid-auto-flowWhich unit is relative to viewport width?
a) vw ✅
b) vh
c) em
d) remWhich unit is relative to the font size of the root element?
a) rem ✅
b) em
c) vh
d) vwThe
clamp()function sets:
a) Min, preferred, and max values ✅
b) Fixed values only
c) Responsive scaling
d) Font scaling onlyThe
@containerrule is used for:
a) Container queries ✅
b) Flex layout
c) Font importing
d) AnimationThe
font-displayproperty controls:
a) Font rendering behavior ✅
b) Font size
c) Font color
d) Font familyThe
font-smoothproperty is used to:
a) Improve text rendering ✅
b) Add shadows
c) Set font size
d) Stretch fontsThe
overflow-wrapproperty controls:
a) Word breaking at the end of lines ✅
b) Line spacing
c) Margin collapse
d) Flex wrappingThe
hyphens: auto;property enables:
a) Automatic word hyphenation ✅
b) Line spacing
c) Paragraph indent
d) Text transformationThe
backface-visibilityproperty controls:
a) Visibility of element’s back during 3D rotation ✅
b) Opacity
c) Shadow
d) Border thicknessThe
perspective-originproperty defines:
a) The vanishing point of 3D elements ✅
b) The animation origin
c) The transform base
d) The flex directionThe
will-changeproperty is used to:
a) Optimize for expected property changes ✅
b) Delay animations
c) Add transitions
d) Reset all propertiesThe
scrollbar-widthproperty controls:
a) The thickness of scrollbars ✅
b) Scroll direction
c) Scroll behavior
d) Scroll colorThe
accent-colorproperty customizes:
a) Checkboxes, radio buttons, etc. ✅
b) Links
c) Headings
d) ImagesThe
caret-colorproperty changes:
a) The text cursor color ✅
b) Font color
c) Border
d) PlaceholderThe
::placeholderpseudo-element styles:
a) Placeholder text in inputs ✅
b) Labels
c) Default text
d) WatermarkThe
:checkedpseudo-class targets:
a) Selected checkboxes and radio buttons ✅
b) Hovered links
c) Disabled inputs
d) Focused elementsThe
:disabledpseudo-class applies to:
a) Disabled form controls ✅
b) Active buttons
c) Hidden text
d) Placeholder textThe
:emptypseudo-class selects elements that:
a) Have no child nodes ✅
b) Have empty attributes
c) Are hidden
d) Have display:noneThe
:targetpseudo-class styles:
a) Elements matched by a fragment identifier ✅
b) Inputs
c) Hidden divs
d) Focused textThe
:in-rangepseudo-class applies to:
a) Inputs whose value is within a specified range ✅
b) Text fields
c) Focused elements
d) Hidden inputsThe
:out-of-rangepseudo-class applies to:
a) Inputs outside valid range ✅
b) Inputs with default values
c) Links
d) Hovered buttonsThe
:focus-visiblepseudo-class:
a) Applies focus styles when user interacts via keyboard ✅
b) Applies focus to all inputs
c) Hides outlines
d) Disables tab focusThe
:has()pseudo-class allows:
a) Selecting elements containing a specific descendant ✅
b) Selecting siblings
c) Selecting ancestors
d) Selecting parents onlyThe
:where()pseudo-class provides:
a) Low-specificity grouping of selectors ✅
b) ID targeting
c) Color filtering
d) Value mappingThe
:is()pseudo-class allows:
a) Matching multiple selectors ✅
b) Inverting selections
c) Filtering attributes
d) Styling pseudo-elementsThe
@layerrule is used for:
a) Layered style organization ✅
b) CSS filters
c) Font imports
d) AnimationsThe
::backdroppseudo-element styles:
a) Background behind modals or dialogs ✅
b) Background images
c) Popovers
d) Scroll areasThe
display: contents;property:
a) Removes box but keeps children visible ✅
b) Hides element
c) Displays as flex
d) Wraps contentThe
object-positionproperty controls:
a) Image alignment inside container ✅
b) Object size
c) Border alignment
d) Background fitThe
clip-path: circle();property creates:
a) Circular shape clipping ✅
b) Border radius
c) Box shadow
d) MaskThe
mask-imageproperty:
a) Defines an image used as a mask ✅
b) Adds shadow
c) Adds gradient
d) Applies borderThe
filter: grayscale(100%);property makes:
a) Image black and white ✅
b) Transparent
c) Blurred
d) ColoredThe
filter: brightness(150%);property:
a) Increases image brightness ✅
b) Darkens image
c) Adds contrast
d) DesaturatesThe
backdrop-filterproperty applies effects:
a) Behind an element ✅
b) To text
c) To borders
d) To child elementsThe
mix-blend-mode: multiply;creates:
a) Color blending like Photoshop multiply ✅
b) Overlay color
c) Normal blend
d) Screen blendThe
scroll-snap-alignproperty controls:
a) Snap position of elements ✅
b) Scroll direction
c) Scroll overflow
d) Scroll paddingThe
writing-mode: vertical-rl;property makes text flow:
a) Vertically from right to left ✅
b) Vertically from left to right
c) Horizontally
d) Upside-downThe
text-orientation: upright;property is used in:
a) Vertical writing modes ✅
b) Flex containers
c) Grid layouts
d) Responsive designThe
line-clampproperty:
a) Limits number of visible text lines ✅
b) Adds ellipsis
c) Controls paragraph width
d) Justifies textThe
:first-letterpseudo-element styles:
a) The first letter of a text block ✅
b) The first word
c) The first sentence
d) The titleThe
:first-linepseudo-element affects:
a) The first line of text ✅
b) The heading
c) The footer
d) The bodyThe
::markerpseudo-element styles:
a) List item markers ✅
b) Paragraphs
c) Input icons
d) LinksThe
@keyframes bouncedefines:
a) A named animation sequence ✅
b) A gradient pattern
c) A flex property
d) A grid template