Understanding Display Property
Which value of the CSS 'display' property removes the element entirely from the document rendering, so that neither the element nor its space is visible on the page?
- inline
- block
- hidden
- none
- collapse
Flexbox Directionality
If you want flex items in a flex container to be stacked vertically instead of the default horizontal layout, which property and value combination should you use?
- flex-direction: row;
- flex-direction: column;
- justify-content: vertical;
- align-items: left;
- display: stack;
CSS Grid Gap Usage
In a CSS Grid container, which property should you use to add space equally between both grid rows and columns without affecting the outer edges of the grid?
- grid-spacing
- grid-gap
- gap
- row-gap
- padding
Keyframes Syntax
Which of the following is the correct way to define a CSS keyframes animation called 'pulse'?
- @keyframes pulse { from { opacity: 1; } to { opacity: 0; } }
- keyframe pulse { 0% { opacity: 1; } 100% { opacity: 0; } }
- @keyframe pulse { 0 { opacity: 1; } 100 { opacity: 0; } }
- @-keyframes pulse { from { opacity: 1; } to { opacity: 0; } }
- @keyframs pulse { 0% { opacity: 1; } 100% { opacity: 0; } }
Difference Between Inline and Inline-Block
Which statement correctly describes the CSS difference between 'display: inline;' and 'display: inline-block;' given the following HTML: u003Cspan style='display:inline;'u003EAu003C/spanu003E u003Cspan style='display:inline-block;'u003EBu003C/spanu003E?
- 'inline-block' allows setting width and height, unlike 'inline'.
- 'inline' elements begin on a new line, 'inline-block' stays on the same line.
- 'inline-block' elements are hidden by default.
- 'inline' elements always stack vertically.
- 'inline-block' ignores vertical-align.
Grid Area Naming
In CSS Grid, what is the purpose of 'grid-template-areas'?
- To assign class names to grid containers.
- To visually group grid lines into sets.
- To define named areas for cell placement within the grid.
- To position the grid container itself on the page.
- To create a border around all grid items.
Flexbox vs. Grid Use Case
Given a layout requirement where you need both vertical and horizontal alignment of items within a two-dimensional matrix, and each cell may span multiple rows or columns, which CSS technique is best suited?
- Flexbox
- Box model
- CSS Grid
- Floats
- Position: absolute;
Cascading Specificity
If three CSS rules are defined for an element, which rule will be applied with the highest priority: 1) .class1; 2) div; 3) #id1?
- div
- .class1
- #id1
- .id1
- id1
Block Formatting Context (BFC)
Which CSS property can trigger a new Block Formatting Context (BFC), helping to contain floats and prevent margin collapsing?
- overflow: hidden;
- display: inline;
- background-color: transparent;
- position: static;
- visibility: collapse;
Responsive Design and Media Queries
What is the primary function of a media query such as '@media (max-width: 600px)' in a CSS file?
- To apply styles to all browsers universally
- To style only HTML elements with 'max-width' inline attribute
- To conditionally apply CSS rules based on the device's screen width
- To minimize the CSS file size
- To disable JavaScript on small screens