DEV Community

Shubham Kumar
Shubham Kumar

Posted on

How to render common webpage elements to all pages?

How to render common web page elements such as NAVBAR, FOOTER, to every page when I am just using HTML, CSS & JS?
I will be not following the DRY principal if I just copy paste elements to every page.
Any ideas?

Top comments (2)

Collapse
 
berniwittmann profile image
Bernhard Wittmann

Another possibility would be the use of WebComponents. With that you can define your own custom html elements, which then get rendered. Check out this quick tutorial about usage of custom elements on MDN

Collapse
 
lingam247 profile image
Daniel Selinger

You can take a look at en.wikipedia.org/wiki/Server_Side_...