This is a quick exercise that demonstrates the different weight values of the three main CSS selector types, tag, class, and id, by targeting the same html tag with each of them.
Go to codepen.io and log into your account.
Next, go to the button icon at the far right top corner and select the "New pen" option.
In the HTML pane, add a div tag.
Within the div tag, type "lorem" and then hit the tab key. This will produce some placeholder text.
Add a class attribute with value "block" to the div:
Add an id attribute with value "intro" to the div:
In the CSS pane, create a "div" tag selector and set the background color to yellow. A yellow background should appear immediately in the output pane.
Below the tag selector, create a "block" class selector and set the background color to orange. The previously yellow background should now change to orange in the output pane.
Below the class selector, create an "intro" id selector and set the background color to red. The previously orange background should now change to red in the output pane.
When done, click the "Save" button.
Click on the "Settings" button. Add the following title "Selector weight" in the title field. Also, add "html" and "css" tags in the tags field.
When you're done, submit a link to your pen via the Assignments option for this week in Insight.