Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it good practice to use iframe to implement header/navbar?

Tags:

html

is it good practice to use iframe to implement header/navbar?

my website is basically 5 thousand pages but all static html (not using any content manager, php, etc.).

am in the process to add a navbar at the top of each page. e.g. tabs, or crumbs, or any sort of header with js menu. (the exact design not decided yet)

my question is, is it good practice to use a iframe for this? (so, instead have same text repeated in all 5 thousand pages, each will just have a short iframe pointing to a header file)

am aware that one should reduce http request for speed, but this is ok with me. Any other problems i might have with this? SEO or any tech issue?

like image 542
Xah Lee Avatar asked Dec 29 '10 18:12

Xah Lee


People also ask

When should you use iframes?

An inline frame (iframe) is a HTML element that loads another HTML page within the document. It essentially puts another webpage within the parent page. They are commonly used for advertisements, embedded videos, web analytics and interactive content.

Are iframes old?

Inline frames (shortened to iFrames) were introduced in the late 1990s by Microsoft, making it one of the oldest HTML tags. From a technology perspective, it's ancient. That said, there are still some legitimate use cases for iFrames.

How to avoid iframe?

There are two primary methods: 1.) Sending an X-Frame-Options HTTP response header that instructs the browser to disable framing from other domains. An example of using PHP to send the X-Frame-Options header.

What can you put in an iframe?

An iFrame, also knowns as Inline Frame, is an element that loads another HTML element inside of a web page. They are commonly used to embed specific content like external ads, videos, tags, or other interactive elements into the page.


1 Answers

Using iframes to display parts of the same document is not good practice. Consider the document as a whole and that should give you the answer. Or consider that there are devices who don't do well when encountering iframes. And speaking of SEO is funny. Documents without header of footer (hence no internal links), or with just the navigation pointing to other iframe wrappers don't do well.

If your goal is to avoid using a dynamic language, how about going for SSI (Server Side Includes)?

like image 108
maus Avatar answered Sep 30 '22 09:09

maus