Hi,

I have one doubt on IFrame in HTML

I wrote some code in a html file and inserted that file in a iframe but it working fine..

but Mozilla give some trouble please help me out this problem

iframe code

<iframe src ="" width="250" height="275" FRAMEBORDER="0" SCROLLING="no" ></iframe>

Dani AI

Generated

Brief diagnosis and practical checks for the Mozilla issue mentioned by (and the cleanup note from ).

Common causes: mixed-content blocking (HTTPS page embedding an HTTP iframe), response headers that forbid framing (X-Frame-Options or CSP frame-ancestors), or malformed markup introduced by copy/paste. Cleaning attributes is good practice — whitespace around = is allowed, but mismatched quotes or stray characters can break parsing in some contexts. reporting identical rendering in IE and FF suggests the problem may be environmental (headers/protocol) rather than simple attribute syntax.

Quick troubleshooting steps

  • Open Firefox Web Console (Ctrl+Shift+K) and look for messages like "Blocked loading mixed active content" or "Refused to display '...' in a frame because it set 'X-Frame-Options'".
  • In Developer Tools > Network, inspect the iframe document's response headers for X-Frame-Options or a Content-Security-Policy with frame-ancestors. These headers will prevent embedding. See MDN on X-Frame-Options and frame-ancestors for details.
  • Confirm the parent page and iframe resource use the same protocol (both HTTPS) to avoid mixed-content blocks. See MDN on mixed content.
  • Test with a minimal local/controlled iframe page (plain HTML) to isolate whether the embedded page or the container is the problem.

Practical fixes and modern best practices

  • Prefer CSS for visual rules instead of deprecated attributes (use style="border:0" rather than frameborder).
  • Add title for accessibility and loading="lazy" for performance. Use sandbox if the iframe content must be restricted.
  • If scrollbars are the issue and the inner page is controllable, set html, body { margin:0; overflow:hidden; } inside the framed document and match the iframe height from the parent.

Example minimal embed (adjust src and sizes to the actual files):

<iframe src="/banner.html" width="320" height="180" style="border:0" title="Support banner" loading="lazy" sandbox="allow-scripts allow-same-origin"></iframe>

Useful references: MDN iframe element (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe), MDN X-Frame-Options (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options), MDN Mixed Content (https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content).

Recommended Answers

All 2 Replies

what is the problem with this? It looks the same to me in both ie and ff.

<iframe src="" width="250" height="275" frameborder="0" scrolling="no" ></iframe>

Just cleaned up html attributes, might be the space after src= that cause the problem.

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.