to get it right, we can use the other pseudo-class :link that is set only on <a> tags that have a href= attribute
let hover_html = `<div>
<a href="https://minesparis.psl.eu/" target="_">
this is a link - hover mouse here
</a>
<br>
<a name="minesparis">
now this is an <a>
tag too but it does not react to hover
since it is excluded from the CSS selector
</a>
</div>`
let hover_css = `/* <a> elements under a .part2
and that have both pseudo-classes */
a:hover:link {
font-size: 200%;
background-color: red;
text-decoration: none;
}`
await tools.sample_from_strings({html: hover_html, css: hover_css}, {start_with: 'css'})
div p matches all <p> elements that are below a <div> element at any depth
div>p matches all <p> elements that are an immediate child of <div> element
let under_html = `<div>
<p>
a <span> span </span> as the div's grandson
</p>
<span> this span is div's immediate son </span>
</div>
`
let under_css = `/* a <span> anywhere under <div> */
div span {
color: red;
}
/* a <span> immediately under <div> */
div > span {
color: green;
}
`
await tools.sample_from_strings({html: under_html, css: under_css}, {start_with: 'css'})