css3 - CSS-Selector for multiple elements -


i not @ getting how use more advanced css-selectors + or > needing prevent js, maybe can me out particular situation of block:

<section class="rf_re1-suche_container">     <input type="search" placeholder="your search">     <button>send</button> </section> 

and wanna that:

.rf_re1-suche_container input:focus{     background:orange; } 

but button. so: if input has focus want input , button have same background. how that? thanks!

you need target input , button separately. because want apply when input has focus, need repeat entire selector including input:focus portion, use + combinator link button focused input:

.rf_re1-suche_container input:focus,  .rf_re1-suche_container input:focus + button {      background: orange;  }
<section class="rf_re1-suche_container">      <input type="search" placeholder="your search">      <button>send</button>  </section>


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -