The ________ CSS selector is used to select the first paragraph inside a container.
- first:p
- p:first
- p:first-child
- first-child:p
The correct option is p:first-child. This CSS selector targets the first child element that is also a paragraph within a container. It's handy for styling the initial paragraph in a specific way without affecting other paragraphs.
Loading...
Related Quiz
- You need to create a layout where a sidebar stays to the left and the main content takes up the remaining width. Which combination of float and width properties would achieve this?
- You are optimizing a website for performance and notice that web fonts significantly slow down the page load time. What strategies could you implement to optimize the loading of fonts?
- Which CSS property is used to vertically align inline elements or inline-block elements?
- What is the primary advantage of using CSS-in-JS solutions like Styled Components in modern web development?
- In a large-scale project using SASS, a team member wants to apply a set of styles in multiple places with slight variations. What SASS feature should they use to achieve this effectively?