What CSS property is used to define the duration of a transition effect?

  • animation-duration
  • duration
  • time-duration
  • transition-duration
The correct CSS property for defining the duration of a transition effect is transition-duration. It specifies the time taken for the transition to complete, and it should be followed by the time value (e.g., 1s for 1 second).

A web designer is tasked with creating a website that is accessible to users with various disabilities. What CSS strategy should be employed to ensure that the website is navigable and readable by screen readers?

  • Excessive use of images and icons
  • Flash animations and multimedia elements
  • Inline styling and embedded CSS
  • Semantic HTML and ARIA roles
To ensure accessibility for users with disabilities, a web designer should use Semantic HTML and ARIA (Accessible Rich Internet Applications) roles. These help in providing meaningful structure and information to assistive technologies like screen readers. Avoiding excessive use of images, flash, or inline styling is crucial for a better user experience for people with disabilities.

Which pseudo-class would you use to style an element that is being hovered over by a mouse pointer?

  • :active
  • :focus
  • :hover
  • :visited
The :hover pseudo-class is used to select and style an element when it is being hovered over by a mouse pointer. This is commonly used for creating interactive and dynamic user interfaces in web development.

In a project using Tailwind CSS, the team needs to implement custom designs that are not available in the framework. How should they approach this without losing the benefits of Tailwind's utility classes?

  • Extend Tailwind's utility classes with custom styles
  • Override Tailwind's default styles directly
  • Use an external CSS framework for custom designs
  • Write entirely new CSS without utilizing Tailwind
Extending Tailwind's utility classes allows the team to leverage the framework's benefits while adding custom styles for unique designs.

CSS variables can be updated in real-time using ________ which makes them powerful for dynamic theming.

  • JavaScript
  • Media Queries
  • CSS Functions
  • Hover States
The correct option is JavaScript. JavaScript can be used to dynamically update CSS variables, providing flexibility for real-time theming in web applications.

Responsive typography can be achieved by using viewport units for font sizes, such as ________.

  • %
  • em
  • px
  • vh
Using viewport units like vh (viewport height) allows font sizes to be responsive to the height of the viewport.

What is the main benefit of using CSS variables (custom properties) in a stylesheet?

  • Better SEO Optimization
  • Enhanced Browser Compatibility
  • Improved Maintainability
  • Increased Page Load Speed
CSS variables, also known as custom properties, offer improved maintainability by allowing the definition of reusable values. This promotes consistency and makes it easier to update styles across the entire website.

In CSS preprocessors like SASS and LESS, what feature allows you to use the same piece of CSS in multiple places?

  • Functions
  • Mixins
  • Selectors
  • Variables
Mixins in CSS preprocessors like SASS and LESS allow you to reuse the same piece of CSS in multiple places. By defining a mixin, you can encapsulate a set of styles and then include it wherever needed, promoting code modularity and maintainability. Variables, functions, and selectors are also important features but serve different purposes.

During a site audit, you notice that unminified CSS is delaying the page's Load Time. Which CSS minification and optimization technique would you recommend to improve performance?

  • Tree shaking
  • CSS gzip compression
  • Optimize CSS delivery using a Content Delivery Network (CDN)
  • Use CSS sprites for background images
Minifying and compressing CSS with gzip reduces file size and speeds up load time. Other options may offer benefits, but CSS gzip compression directly addresses unminified CSS impacting load time.

Which tool can be typically used for cross-browser testing of web applications?

  • Adobe Photoshop
  • BrowserStack
  • CodePen
  • GitLab CI
BrowserStack is a popular tool for cross-browser testing, allowing developers to test their web applications on various browsers and devices to ensure a consistent user experience.