html - CSS: how to cascade class-specific style to children -


suppose have html table has been assigned class dependency_table.

how can style tr, th, , td children of that specific table without having put class="dependency_table" in of child tags?

here have tried far:

/* --- dependency table styling --- */ .dependency_table {     border-collapse: collapse;     color: pink; }  .dependency_table ~ td {     background: #fafafa;     text-align: center; }  .dependency_table ~ th{      background: #dfdfdf;  /* darken header bit */      font-weight: bold; } 

the general sibling selector hasn't worked me yet syntax. correct way of doing this?

if understand correctly want this:

/* --- dependency table styling --- */ .dependency_table {     border-collapse: collapse;     color: pink; }  .dependency_table td {     #your style }  .dependency_table th{      #your style }  .dependency_table tr{          #your style     } 

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 -