I have a CSS class that is being used to show many DIVs in a CSS layout-grid format:
.wrapper {
display: grid;
grid-templpate-columns: 200px 200px 200px;
}
and through javascript, I changed the width of some elements that make use of it (i.e. getElementByClass("wrapper")
and looping). It works fine for those that are already displaying:
Problem: when I add a new DIV via JS, the new DIV would only revert to widths of 200px!
Seems to me that when generating a new element (by code), the browser calls up the original template and simply map it (using all 200px) to the new element I just created!
I've looked around and cannot find topics relating to altering the "master" css template being stored somewhere...
Question: Is there a way to permanently alter the loaded CSS template's properties?
Note: I cannot loop through ".wrapper" to alter the newly added element because I'm using Angular4 and seems that it doesn't run any more code after rendering the template (here altering the table view)