使用iframe来实现标题/导航栏是不是很好? [英] is it good practice to use iframe to implement header/navbar?

查看:72
本文介绍了使用iframe来实现标题/导航栏是不是很好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用iframe来实现header / navbar是不错的做法吗?

我的网站基本上是5千页但全部是静态html(不使用任何内容管理器,php等等)。



我正在为每个页面的顶部添加一个导航栏。例如标签或面包屑,或任何类型的标题与js菜单。 (确切的设计尚未决定)

我的问题是,为此使用iframe是否很好? (所以,在所有5千个页面中重复使用相同的文本,每个页面都只有一个指向头文件的短iframe)



我知道应该减少http请求为了速度,但这对我来说还可以。任何其他问题,我可能与此?搜索引擎优化或任何技术问题?

解决方案

使用iframe显示同一文档的部分不是好习惯。把整个文件看作是一个整体,应该给你答案。或者考虑到有些设备在遇到iframe时效果不佳。说起SEO很有趣。没有页脚的文档(因此没有内部链接),或者只是指向其他iframe包装的导航不太好。



如果您的目标是避免使用一个动态的语言,如何去SSI(服务器端包括)?

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?

解决方案

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)?

这篇关于使用iframe来实现标题/导航栏是不是很好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆