this post was submitted on 03 Aug 2023
13 points (93.3% liked)
Web Development
3434 readers
1 users here now
Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development
What is web development?
Web development is the process of creating websites or web applications
Rules/Guidelines
- Follow the programming.dev site rules
- Keep content related to web development
- If what you're posting relates to one of the related communities, crosspost it into there to help them grow
- If youre posting an article older than two years put the year it was made in brackets after the title
Related Communities
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Wormhole
Some webdev blogs
Not sure what to post in here? Want some web development related things to read?
Heres a couple blogs that have web development related content
- https://frontendfoc.us/ - [RSS]
- https://wesbos.com/blog
- https://davidwalsh.name/ - [RSS]
- https://www.nngroup.com/articles/
- https://sia.codes/posts/ - [RSS]
- https://www.smashingmagazine.com/ - [RSS]
- https://www.bennadel.com/ - [RSS]
- https://web.dev/ - [RSS]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
p sure you're looking for a web component. You'll create a new component that can be used like
<my-header></my-header>
Then import the file with the definition of the custom web component on both pages et voilà! You've shared your header between pages.
I will admit I'm a bit biased because I'm the author of a web component framework: https://tybalt.org . But! I still think that's what you're looking for.
I haven't used web components, but from everything I have read, it's the way to do this without using frameworks or templating or whatever.
For OP:
Moz docs:
https://developer.mozilla.org/en-US/docs/Web/API/Web_components
This article seems to address exactly what you want?
https://www.freecodecamp.org/news/reusable-html-components-how-to-reuse-a-header-and-footer-on-a-website/
Here are some articles I have skimmed and seem useful?
https://coderpad.io/blog/development/intro-to-web-components-vanilla-js/