It depends on the programming language you use.
If you include an HTML file with (iframe), you cannot do what you want.
If you include a PHP file with (include) it will work the way you want.
For example:
index.php
include to a svgs.php
file.
However, you may want to consider creating an icon file with SVG Sprites. [See]
So you can load and recolor multiple icons from a single ".svg" file using short commands like below.
Remember: This technology does not support some SVG features such as Gradient. [1] [2]
<svg viewBox="0 0 24 24" class="icon">
<use href="#foo"></use>
</svg>
<svg viewBox="0 0 24 24" class="icon">
<use href="#bar"></use>
</svg>
Automatic SVG sprite generator tool: https://svgsprit.es/
Finally, you can use 3rd part scripts such as SVG injectors.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…