TheLivingLegend27
TheLivingLegend27

Reputation: 11

Making one element for all pages?

I am just starting to learn HTML. I am trying to understand if it is possible to only have one element in the mainpage that can be use on every other pages instead of rewriting it onto every other single html file?

Thank you.

Upvotes: 1

Views: 343

Answers (1)

Sohan Arafat
Sohan Arafat

Reputation: 93

What you are talking about is called a component. A component is a reusable piece of small elements that you can use anywhere in your html. You can do it in two ways:

  1. Server side: Make a function where you store that specific component.
  2. Dynamic template: Use something like VueJS,ReactJS or AngulerJS to create and use a component where ever you like it. You can also use JS too. But I suggest VueJS,ReactJS or AngulerJS.

Upvotes: 2

Related Questions