html - How do I select the next item after a target element in css? -



html - How do I select the next item after a target element in css? -

i have follow:

<a name="a"></a><b>a</b>

i want select next item, <b>, , highlight when target selecting. select in a tag use: (for example)

[id]:target {background:pink;}

and works. however, when utilize this:

[id]:target + b {}

this doesn't work. not possible css? wish wrap tag around item, don't have alternative here.

it not work, if utilize attribute "name" , "id" in css.

class="snippet-code-css lang-css prettyprint-override">[id]:target { background:pink; } [id]:target + b { background:pink; } class="snippet-code-html lang-html prettyprint-override"><a id="a">a</a> <b>b</b> <a href="#a">turn pink!</a>

this turns both , b pinkish (tested in chrome / firefox)

html css css3

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -