CSS CSS Selectors Advanced Selectors :nth Pseudo-Class Challenge - Pt. 2

It looks like an <h1> made its way inside the parent body. Now our :nth-child selector no longer targets the desired com

It looks like an <h1> made its way inside the parent body. Now our :nth-child selector no longer targets the desired combination of img child elements. Replace :nth-child with the pseudo-class that only targets a specific type of child element. What is the code for this ? I keep getting it wrong

style.css
/* Write the CSS in the media query below */

@media (min-width: 607px) {
  img {
    float: left;
  }
  :nth-of-type(-n+3) {
   clear: left;
  }
}
index.html
<!DOCTYPE html>
<html>
<head>
    <title>Selectors</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
   <h1>My Gallery</h1>
    <img src="thumb-forest.jpg" alt="">
    <img src="thumb-resort.jpg" alt="">
    <img src="thumb-trees.jpg" alt="">
    <img src="thumb-falls.jpg" alt="">
    <img src="thumb-view.jpg" alt="">
    <img src="thumb-sunset.jpg" alt="">
    <img src="thumb-lake.jpg" alt="">
    <img src="thumb-beach.jpg" alt="">
    <img src="thumb-bay.jpg" alt="">
    <img src="thumb-peaks.jpg" alt="">
    <img src="thumb-falls.jpg" alt="">
    <img src="thumb-resort.jpg" alt="">
</body>
</html>

1 Answer

Steven Parker
Steven Parker
203,729 Points

You have identified the correct pseudo-class, but the tag name part of the selector got accidentally removed. You'll need to put that back as it was.

You also should not change the arguments that are being passed to the pseudo-class.