css3 - CSS all that start with chaining - CSS select all IDs that start with "u" and are in :hover and control other id that start with u -


i hope i'll able explain.

i've got automatically generated code wish override css.

here example of code wish override:

#u1150:hover #u1153-4 p {color: red} 

important: "u" in code generated, other numbers randomly generated , added u (e.g. #u3726 or #u3427-12). since can count on u being generated, want grab control on ids via u letter , change color tried this:

[id^u]:hover [id^u] p {color: green !important} 

in plain language tried to:
1. select ids start u , in :hover
2. further select ids start u
3. further select p tag , give different color (in case green)

can achieved because code isn't achieving desired result.

you're missing = symbol after ^.

[id^="u"]:hover [id^="u"] p { ... } 

[id^="u"]:hover [id^="u"] p {    color: green;  }
<div id="u123">    <span id="u124">      <p>hover here make green</p>    </span>  </div>    <hr>    <div id="u245">    <div>      <div id="u246">        <p>hover here make this...</p>        <span>          <p>...and green</p>        </span>     </div>    </div>  </div>


Comments

Popular posts from this blog

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - SSE Emitter : Manage timeouts and complete() -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -