Sajid Mohammed
Sajid Mohammed

@sajid_curious

4 Tweets 2 reads Oct 08, 2022
💡CSS TIP 💡
Guys we don't need to assign id and class for every child of a parent container to select it .
Just use
:nth-child() Selector to select the desired child of a parent.
Check below Example 👇👇
➡️ HTML
→ Inside a parent div, I opened five child divs.
➡️ CSS
→ By using :nth-child() selector we can select any child inside the parent container.
→ In this example I selected even and odd child elements separately.
→ You can also select individual child using this property.
If you found it useful
Follow @sajid_curious for more tips and Web development content
Like 💖
Retweet ⚡

Loading suggestions...