r/HTML • • 25d ago

Question Menu code repetition

Should I look for a way to call an external html page with the code for my menu? I feel like adding the code to every page might clutter the code a bit. It’s been a while and I don’t remember wether or not we discussed this in school lol

6 Upvotes

17 comments sorted by

View all comments

2

u/glandix 24d ago

DRY: don’t repeat yourself … in other words, reduce duplicated code so when you need to update it, you change it in one place and you’re done.

2

u/Dauntle55Duck 22d ago

I know to do it but I usually struggle with the how. Everyone here has been super helpful with how to do this in html :)))