Hi,

My website looks fine on Firefox and IE with fixed width on different screen resolutions.
On Chrome instead of having a fixed width, my site covers the entire screen,
even in case of high resolution, and the site seems broken because of it.
How can I fixed this annoying problem?

My website:

My CSS file:

Thanks a lot in advance :)

Dani AI

Generated

’s tip to explicitly constrain the table width fixed the exact problem reported: Chrome was letting an unconstrained element expand to the viewport while Firefox/IE used a narrower layout. The core cause in these cases is the browser table-sizing algorithm — when a table has no explicit constraints it can size differently across engines. See MDN on table-layout for details.

Practical, more robust approaches:

  • Wrap page content in a fixed or max-width container so inner elements can’t overflow the intended layout.
.page-wrap {
  max-width: 960px;
  margin: 0 auto;
}
  • For table-driven blocks, either give the table an explicit pixel width or use table-layout: fixed to force predictable column sizing:
.my-table {
  table-layout: fixed;
  width: 100%; /* or width: 960px for a true fixed layout */
}
  • Make media scale-inside the layout: images and large blocks should have max-width: 100% so they don’t blow out their container (see MDN on max-width).

Quick debugging checklist for cross-browser width issues:

  • Inspect in Chrome DevTools: check Computed styles for any element with a large width or min-width.
  • Temporarily outline elements or run a small script to find elements wider than document.documentElement.clientWidth (helps find rogue images or long unbroken text).
  • Confirm a correct DOCTYPE to avoid quirks-mode differences.

If a simple width fix worked (as it did here), add one of the above safeguards to prevent regressions when content changes.

Recommended Answers

All 2 Replies

Set width for Table, will solve this problem

Thanks a lot, it solved the problem,
Now my site has fixed width also on Chrome.

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.