Hi,
I'm building a website and using CSS. Just finished the layout but if I type something inside the content tag of the index page, that content shows on every other page in the website. ie. I click in the "about me" button and that same line I typed in the index.html page shows up, so does in every other page.

What can I do so each page has its own separate content within the id content?

*I am sure the buttons link to a different html file by the way, so that's not the problem so far.

Thank you all!!!

Dani AI

Generated

Symptom summary and likely causes: identical text showing up on every page almost always means the site is serving the same source for multiple URLs. Typical reasons are a shared template or server-side include that contains the content block, a frame/iframe or single-page script that always injects the index content, nav links that actually load the index file, a stray <base> tag changing relative paths, or server rewriting/caching. As suggested, having the actual HTML/CSS makes it much easier to pinpoint which of these is happening. As hinted, template behavior is a common source — editing a template or a global include will change every page that uses it.

Quick diagnostic checklist (apply these in order):

  • Open each page and use View Source (Ctrl+U) to see whether the HTML sent by the server actually contains the duplicate text in the body.
  • Check the browser address bar and the network panel (DevTools) to confirm different files are being requested and returned.
  • Search page files for include/require/<!--#include--> or for an <iframe> / frameset that might be pointing at index.
  • Look for a <base href="..."> in the head that could make relative links point back to index. See MDN on the base element for details: base — MDN
  • Disable JavaScript briefly to rule out client-side routing/injection.
  • Clear caches or try a forced reload (Ctrl+F5) or a different browser to exclude caching.

Small examples of what to look for:

<a href="about.html">About</a>

versus a mistaken link like:

<a href="/">About</a>

and a problematic base tag:

<base href="https://example.com/index.html">

Fixes depend on the cause: if using includes/templates, move the unique page text into a page-specific file or the template's editable region; if links point to the wrong file, correct the href; if an iframe is used, change it to load the correct page; if server rewriting is involved, fix the rewrite rules. If the problem persists, share the page head, the nav links, and the #content region HTML/CSS so the exact issue can be diagnosed.

Recommended Answers

All 2 Replies

It will help to help you if you give us your css/html code to inspect

Don't type inside the content tags unless those tags are within the body tags of a page template so that each page can be saved/published and a new page can be created using the template containing the css.You cannot use the index page as a template,only part of the code such as css,head and footer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.