css - How to add class to all elements inside div? -


i have 100 buttons inside div:

<div class="button_group">   <button> ... </button>   <button> ... </button>   <button> ... </button>   ... </div> 

i want style buttons in bootstrap style. so, need change everywhere < button > < button class="btn" >. want without adding class="btn" 100 times each < button > element. so, need css rule says buttons inside div of class "btn". so, need this:

.button_group button {   ... add class="btn" elements ... }  

is possible @ all? correct syntax?

thank you!!

html

<div class="button_group">   <button> ... </button>   <button> ... </button>   <button> ... </button> </div> 

css

.button_group > button {width: 100px; height: 50px;} 

and fiddle https://jsfiddle.net/049lj4ll/4/

there no need ad class="btn" every button if same, add class parent div have class="button_group" able identify specific group of buttons. https://jsfiddle.net/049lj4ll/6/ , https://jsfiddle.net/049lj4ll/7/


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -