Which of the following is NOT a unit for font-size in CSS?
- cm
- em
- ex
- px
In CSS, font-size can be specified in various units, including em, ex, px, and cm. However, 'cm' is not a common unit for font-size. It's typically used for specifying dimensions of other elements, like margins or padding.
Which extension is used for SCSS files?
- .css
- .scss
- .html
- .js
SCSS (Sassy CSS) files have the ".scss" extension. This extension is used to indicate that the file contains SCSS syntax, which is a more CSS-like syntax with additional features provided by SASS.
The pseudo-class :nth-of-type(2) in CSS targets the ________ of its type.
- any element
- first element
- last element
- second element
The pseudo-class :nth-of-type(2) in CSS targets the second element of its type. It allows you to select and style the second occurrence of an element type within its parent container. This is useful for creating specific styles for the second element, such as the second paragraph or the second list item.
What does the text-transform property do in CSS?
- Adjusts the text's spacing
- Alters the text's font size
- Changes the text's color
- Transforms the text into uppercase
The text-transform property in CSS is used to control the capitalization of text. Setting it to "uppercase" transforms the text to all uppercase letters, while "lowercase" makes it all lowercase.
Which CSS property allows you to control the speed curve of an animation?
- animation-ease
- animation-speed-curve
- animation-timing-function
- animation-transition
The animation-timing-function property is used to control the speed curve of an animation. It allows you to specify how the animation progresses through time, giving you control over the easing and acceleration of the animation.
The CSS unit vh represents a percentage of the ________.
- Font Size
- Height
- Viewport
- Width
The CSS unit 'vh' represents a percentage of the viewport's height. This means that 1vh is equal to 1% of the height of the viewport in which the web page is displayed. It's a relative unit often used for responsive design.
The @font-face rule allows web designers to use fonts that are not ________ on the user's machine.
- available
- compatible
- installed
- recognized
The @font-face rule in CSS allows web designers to use fonts that are not installed on the user's machine. This is useful for ensuring consistent typography across different devices.
With PostCSS, developers can write plugins to create custom ________ for their projects.
- Compilers
- Frameworks
- Templates
- Transformations
PostCSS is a versatile tool that allows developers to create custom transformations or plugins for their projects. These transformations can be used to modify or extend the functionality of CSS, making it a powerful and flexible tool for developers.
Which CSS property allows you to set a graphical element to be used as a mask against an element?
- element-mask
- mask-clip
- mask-image
- mask-layer
The CSS property that allows you to set a graphical element to be used as a mask against another element is mask-image. This property lets you specify an image or SVG as a mask, which defines the transparency of an element based on the mask's alpha channel. It's often used for creating complex visual effects and overlays.
In a React application, you are tasked with styling a button that changes its background color based on a prop passed to it. Which CSS-in-JS library would be ideal for this?
- Styled-components
- Bootstrap
- Tailwind CSS
- SCSS
Styled-components is a popular CSS-in-JS library for React. It allows you to define component styles directly in your JavaScript code and can easily style components based on props, making it ideal for dynamic styling based on prop values.