Figure 1.25. A comments section as you might find on a blog
Eachcommentintheaforementionedcodehasafragmentidentifier,whichmeans
wecanlinkdirectlytoit.Forexample,.Then
allweneedtodoisspecifyastyleforthiscommentusingthe:targetpseudo-class:
.comment:target {
background: #ffeb3b;
border-color: #ffc107
}
WhenthefragmentidentifierpartoftheURLmatchesthatofacomment(forex-
ample,http://example.com/post/#comment-1146937891),thatcommentwillhave
ayellowbackground,seeninFigure1.26.
Selectors 39