When we have several pages using the same styles and JavaScript, we can:
This strategy will certainly work, but it defeats the purpose of style sheets - the ability to separate style from content.
We could set all the <div>s to be invisible in the style sheet, and then explicitly set all the initial style attributes from a shared JavaScript .js file. This is a reasonable solution when every page starts out in the same initial state.
If we can find a way to access the styles that are in the stylesheet, we have the greatest flexibility; we can use a style across multiple pages, and, since we can access them from JavaScript, we can read the initial conditions rather than use fixed code to set them.
Where Properties Reside | Index | Accessing Style Sheets |