Coding task · HTML and CSS course · Module 3: CSS Basics

Advanced selectors in practice

You learned the universal (*), child (>), adjacent sibling (+), general sibling (~) and attribute selectors. Now practice them on an Egyptian structure.

Task

Open style.css and analyze the advanced selectors: universal (*), child (div > p), adjacent sibling (h2 + p), general sibling (h2 ~ p) and attribute (a[href*="google"]). Change the colors to see which elements each selector affects: set color: #4A3C2A in the universal selector, color: #1E90FF in the child selector and color: #228B22 in the attribute selector, and add color: #8B4513 to the adjacent sibling selector.