Visually connect tags, selectors, and elements on the page
In order to aid students’ understanding of the relationship between different bits of the code, it would be very cool to visually connect selectors to tags, and vice versa. E.g., if I place the cursor within a selector in the CSS code, we could subtly highlight (maybe with an outline) the tag(s) in the HTML that correspond to it. Similar thing with jQuery selectors (this is more of a bonus feature though).
As a corollary, placing the cursor in a tag should (subtly!) highlight the element on the page corresponding to that tag; placing the cursor in a CSS selector should highlight all elements on the page matching that selector.
N.B. I think Cloud9 might do this to some extent? Would be worth exploring if they’ve published any open source code that might get us some of the way there.
Other useful things:
- Highlight the closing tag/brace/bracket/etc. when you’re focused on the opening, and vice versa (pretty standard editor feature)
- Highlight the actual portion(s) of the preview corresponding to the focused tag/selector/etc.