In CSS methodology, what does BEM stand for?

  • Basic Element Method
  • Best Element Model
  • Block Element Modifier
  • Browser Extension Module
BEM stands for Block Element Modifier. It is a methodology for naming CSS classes in a way that makes it clear which component a class belongs to and how it can be used within that component. This helps in creating modular and maintainable code.

Which CSS property is used to specify different styles for different screen sizes?

  • media-query
  • responsive-style
  • screen-style
  • viewport-style
Media queries are used to apply different styles for different screen sizes. They allow you to create responsive designs by adapting the layout and styles based on the characteristics of the device or browser.

A website has a high First Contentful Paint (FCP) time. What CSS optimization strategy could be most effective in improving this metric?

  • Inline critical CSS
  • Minify and concatenate CSS files
  • Use asynchronous CSS loading
  • Implement lazy loading for CSS files
First Contentful Paint (FCP) time is crucial for user experience. Inline critical CSS can prioritize essential styles, reducing FCP. Other options may help, but inline critical CSS directly addresses FCP concerns.

The ________ property in Flexbox can be used to set the order in which a flex item appears within a flex container.

  • order
  • flex-order
  • arrange
  • flex-sequence
The correct option is order. The order property in Flexbox is used to set the order in which a flex item appears within a flex container. It takes a numerical value, and items are displayed in ascending order. flex-order, arrange, and flex-sequence are not valid properties.

For optimal performance, CSS __________ should be kept to a minimum to reduce complexity and browser reflow.

  • Media Queries
  • Pseudo-Classes
  • Selectors
  • Specificity
Minimizing the usage of complex selectors in CSS is crucial for performance optimization. This practice reduces the workload on the browser's rendering engine, leading to faster page loading times and a smoother user experience.

How can the use of external CSS files impact the critical rendering path of a webpage?

  • Asynchronous Loading
  • Delayed Rendering
  • Parallel Loading
  • Synchronous Loading
External CSS files can be loaded in parallel, allowing the browser to fetch them concurrently with other resources, reducing the critical rendering path time and improving page loading speed.

What is the stacking context in CSS and how can it be affected by the z-index property?

  • A stacking context is a three-dimensional conceptualization where elements are layered on top of each other.
  • A stacking context is formed when an element's position property is set to relative or absolute.
  • The z-index property can only be applied to elements within the same stacking context.
  • The z-index property can only be used on positioned elements (position property set to relative, absolute, or fixed).
A stacking context is created when an element is positioned, and it determines the order in which elements are rendered. The z-index property controls the stacking order within a stacking context. Understanding how elements form stacking contexts and the impact of z-index is crucial for managing the visual hierarchy in complex layouts.

What is the main advantage of using a methodology like OOCSS?

  • It focuses solely on the layout of the webpage
  • It increases the specificity of CSS rules
  • It limits the flexibility of styling
  • It promotes code reusability and reduces redundancy
Object-Oriented CSS (OOCSS) promotes code reusability by separating structure and skin. This means styling for layout is kept separate from styling for visual design, making the code more modular and easier to maintain.

What is the impact of CSS on the browser's Critical Rendering Path?

  • Delays rendering until all styles are loaded
  • Has no effect on the Critical Rendering Path
  • Improves rendering speed by optimizing style application
  • Increases rendering time by adding an extra step
CSS affects the Critical Rendering Path positively by optimizing style application. Efficient CSS usage can lead to faster rendering times.

When setting borders in CSS, the shorthand property order is border: ________ ________ ________; for width, style, and color, respectively.

  • width, style, color
  • style, color, width
  • color, width, style
  • style, width, color
The correct option is style, color, width. When setting borders using the shorthand property 'border,' the order for specifying values is style, color, and width. This allows for a concise way of defining border properties in a single declaration.