Now I can just link people to the ID of a specific part of a help guide and it will automatically highlight the relevant passage.
Perfect.
]]>
h2:target {
color: #f00;
}
h2:target {
background: #f00;
}
]]>I think one of the reason that make this technique hard to use in large websites could be the unability to create multi-level lists with this :
Example :
Four links in 2 categories
- #category1-link1
- #category1-link2
- #category2-link1
- #category2-link2
Category 1
Category 2
Then, this way you can style the 2nd-level links (#categoryX-linkY), but how can you know how to style #category1 and category2? You can’t. Because #category1:target and #category2:target never happen.
The only solution I see is parent selectors but it’s not even implemented in browsers yet.
]]>