The ______ property in CSS lets you apply a delay before an animation starts.
- animation-delay
- animation-pause-delay
- animation-start-delay
- transition-delay
The property in CSS that allows you to apply a delay before an animation starts is the animation-delay. This property is used to create a pause before the animation begins, which is especially useful for sequencing animations.
You are tasked with ensuring that all hyperlinks have no underlines but should be underlined when hovered over. How would you implement this using CSS?
- a { text-decoration: none; } a:hover { text-decoration: underline; }
- a { text-decoration: underline; }
- a { text-decoration: underline; } a:hover { text-decoration: none; }
- a:hover { text-decoration: underline; }
To ensure that hyperlinks have no underlines by default but are underlined when hovered over, you should use the CSS rule a { text-decoration: none; } to remove the underlines from all anchor elements and then use a:hover { text-decoration: underline; } to specify that underlines should appear when the link is hovered.
OOCSS primarily focuses on separating container and content, and promoting the reuse of ________.
- CSS rules
- HTML elements
- JavaScript functions
- Styles
Object-Oriented CSS (OOCSS) emphasizes separating the container and content in your styles and promoting the reuse of styles (i.e., CSS rules). This approach helps keep your CSS modular, making it easier to maintain and reducing redundancy in your code.
When using Styled Components, how would you dynamically change the style of a component based on its props?
- Create separate component variants for each style and switch between them using conditional rendering.
- Styled Components do not support dynamic style changes based on props.
- Use the class prop to assign different CSS classes based on prop values.
- Use the style prop to pass in an inline CSS object and conditionally apply styles based on prop values.
In Styled Components, you can dynamically change the style of a component based on its props by using the style prop. You can pass in an inline CSS object and conditionally apply styles based on the values of the props. This allows for the creation of versatile and reusable components.
What is the default value of the box-sizing property in CSS?
- border-box
- content-box
- margin-box
- padding-box
The default value of the 'box-sizing' property in CSS is 'content-box.' In this mode, the width and height of an element do not include padding or borders, only the content is considered. This can sometimes lead to unexpected layout behavior, which is why 'border-box' is often preferred.
What would be the primary reason to avoid excessive nesting in SASS or SCSS?
- Excessive nesting can lead to increased file size
- It helps with better code organization
- It improves the performance of stylesheets
- It is a recommended best practice
Excessive nesting in SASS or SCSS can lead to bloated and inefficient CSS files, which are larger in size. This negatively impacts loading times and page performance. It is advisable to avoid deep nesting to keep the stylesheet lean and maintainable.
A font's loading performance can be improved by ________.
- compression
- inlining
- minifying
- preloading
A font's loading performance can be improved by "preloading." Preloading involves using the link element in the HTML to fetch and cache font files in advance, reducing the time it takes to load and render text with custom fonts.
Which of the following are common uses of Regular Expressions in PHP?
- Validating user input, such as email addresses or phone numbers.
- Performing string substitutions or manipulations.
- Parsing and extracting data from text, such as log files or web scraping.
- Searching and filtering text data based on specific patterns.
Common uses of Regular Expressions in PHP include validating user input, such as email addresses or phone numbers, by checking if they match the required pattern. Regular Expressions are also used for performing string substitutions or manipulations, allowing you to search for specific patterns in a string and replace them with desired values. They are useful in parsing and extracting data from text, such as log files or web scraping, as they can match and extract specific patterns. Additionally, Regular Expressions are employed in searching and filtering text data based on specific patterns, providing a powerful tool for data manipulation and analysis. Learn more: https://www.php.net/manual/en/book.regex.php
You have a floating-point number in your PHP script and you need to round it to the nearest integer. How would you do this?
- round($number)
- ceil($number)
- floor($number)
- intval($number)
To round a floating-point number to the nearest integer in PHP, you can use the round() function. The round() function rounds a floating-point number to the nearest whole number. It accepts a single argument, the number to be rounded, and returns the rounded value. The rounding behavior can be modified by specifying the optional precision parameter. This function is useful when you need to round a floating-point number to the nearest integer. Learn more: https://www.php.net/manual/en/function.round.php
What can be the potential issues with a while loop in PHP?
- Infinite loop if the condition is never false
- No iteration if the condition is initially false
- Difficulty in maintaining loop control variables
- Performance overhead due to continuous condition checking
The potential issues with a while loop in PHP include the possibility of an infinite loop if the condition is never false. This can occur if the condition is not properly updated within the loop or if the loop control variable is not correctly modified. Another issue can arise if the condition is initially false, resulting in no iterations of the loop. Additionally, maintaining loop control variables can sometimes be challenging, and continuous condition checking may introduce a performance overhead. It is essential to ensure that the condition in a while loop is properly managed to avoid unintended consequences. Learn more: https://www.php.net/manual/en/control-structures.while.php