How can you pause an animation before it begins or between iterations?
- animation-delay
- animation-hold
- animation-pause
- animation-play-state
To pause an animation before it begins or between iterations, you should use the animation-play-state property. By setting it to paused, you can temporarily halt the animation. This is useful for creating interactive animations and controlling when they start or stop.
You're working on a responsive design where you want a row of items to wrap onto the next line when there isn't enough space. Which Flexbox properties would you adjust?
- align-content and flex-basis
- flex-direction and flex-wrap
- justify-content and align-items
- order and flex-grow
To make a row of items wrap onto the next line when there isn't enough space in a Flexbox layout, you would adjust the flex-direction property to "column" (for vertical stacking) and flex-wrap to "wrap." This allows the items to stack vertically when space is limited.
In the context of CSS masking, what does the mask-composite property do?
- Combines a mask image with the element using the blend mode specified.
- Defines the shape of the mask by specifying a path.
- Determines the transparency of the mask image.
- Specifies the position of the mask image relative to the masked element.
The mask-composite property in CSS is used to determine how a mask image should be combined with the element it's applied to. It's used to control the blending mode of the mask image with the element, allowing for various effects.
How can you include a custom font in your webpage using CSS?
- Use the font-color property and specify the font's name
- Use the font-family property and specify the font's name
- Use the font-size property and specify the font's URL
- Use the text-transform property and specify the font's path
To include a custom font in your webpage using CSS, you use the font-family property and specify the font's name. You need to first import the font into your CSS file or link to an external font file, and then you can reference it using the font-family property in your CSS rules. This allows you to apply the custom font to specific text elements on your webpage.
Which CSS property is used to set the font family for an element?
- font-family
- font-size
- font-style
- font-weight
The font-family property in CSS is used to specify the font family for an element. This property allows you to define the typeface or font you want to use for text within that element, which can greatly affect the visual style of your website.
In CSS, when a variable is not set or its value is invalid, it will return the ________ value.
- Default
- Initial
- Null
- Undefined
In CSS, when a variable is not set or its value is invalid, it will return the default value. This default value varies depending on the property. For example, the default value for the font-size property is often 16 pixels.
Which CSS value for font-weight represents normal text?
- Default
- Lighter
- Normal
- Regular
In CSS, the font-weight property is used to control the thickness of the text. The value "normal" corresponds to the standard or regular font weight, making it neither bolder nor lighter.
What's the result of applying the grayscale(100%) filter to a colored image?
- The image becomes completely black
- The image becomes completely white
- The image becomes grayscale
- The image remains the same
Applying the grayscale(100%) filter to a colored image will turn the image completely black. The grayscale filter in CSS converts the image to grayscale, and when you specify 100%, it means full grayscale, which results in a black and white image with all color information removed.
What's the difference between the CSS functions min(), max(), and clamp()?
- clamp() returns a value between the minimum and maximum values provided as arguments.
- max() returns the minimum value among its arguments.
- min() and max() are the same.
- min() returns the maximum value among its arguments.
In CSS, the min() function returns the minimum value among its arguments, while the max() function returns the maximum value. These two functions are complementary but serve different purposes. The clamp() function, on the other hand, allows you to set a value within a range, ensuring it stays between the minimum and maximum values provided as arguments.
What is the primary purpose of the filter property in CSS?
- Applying colors to text
- Applying transformations to elements
- Applying visual effects to elements
- Controlling the layout of elements
The primary purpose of the filter property in CSS is to apply visual effects to elements. This property allows you to add various effects like blurring, brightness adjustment, and grayscale to an element. It's commonly used for image effects and enhancing the visual appearance of web content.
In a media query, which feature is commonly used to detect the width of the viewport?
- device-width
- resolution
- screen-size
- viewport-width
The device-width feature is commonly used in media queries to detect the width of the viewport. It specifically targets the width of the output device, which is important for creating responsive designs that adapt to different screen sizes. By using device-width in media queries, you can apply different styles and layouts based on the device's screen width.
What is the primary purpose of the grid-template-areas property?
- To control the alignment of grid items
- To define the background color of grid areas
- To set the font style for grid items
- To specify the layout of the grid by assigning a name to grid areas
The primary purpose of the grid-template-areas property is to specify the layout of the grid by assigning a name to grid areas. This allows for a visual representation of the grid structure and helps in creating complex and responsive layouts with CSS Grid.