DEV Community


How to render common webpage elements to all pages?

Shubham Kumar
Frontend Developer | React.js | JavaScript 😎
・1 min read

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?

Discussion (2)

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

lingam247 profile image
Daniel Selinger

You can take a look at