# HTML/CSS standard menu items without frames?

**URL:** <https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426>\
**Category:** Factual Questions\
**Created:** [February 21, 2004, 10:47pm UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426 "2004-02-21T22:47:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tusculan](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Tusculan](https://boards.straightdope.com/u/Tusculan)\
**Post date:** [February 21, 2004, 10:47pm UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/1 "2004-02-21T22:47:37Z")

</div>

I’m trying to catch up with modern website design, going all fancy with CSS and XHTML compliance. So far, so good.

Now I’m setting up a standard design with a menu on the left hand side of the screen, which should be the same on every page of the website. Tou know the drill: menu item 1: blah, menu item 2: blah squared, etcetera.

I have put the style definitions in a separate .css file, but I can’t figure out whether there is a way to put the _content_ in a separate ‘sub’-file as well.

I can of course simply copy the content for the menu items into every page, but if I want to modify the links this will become a hassle. I could use frames, but I’ve learned that you shouldn’t use those if you can avoid it at all. What I’m really looking for is a way of ‘linking’ a sub-HTML file in the same way as I can link a style sheet.

So is there some way to do this, or am I simply out of luck?

---

<div class="post-metadata">

**Author:** ![Kinthalis](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kinthalis/32/16084_2.png) [@Kinthalis](https://boards.straightdope.com/u/Kinthalis)\
**Post date:** [February 21, 2004, 11:41pm UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/2 "2004-02-21T23:41:23Z")

</div>

You CAN link another HTML file unto your page by using the SSI include command:

\<!–#include file=“whatever.html”-\>

Hmm, but I think this only works on an ASP environment.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 22, 2004, 12:07am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/3 "2004-02-22T00:07:41Z")

</div>

You can do it with an iframe. Frame purists will still recoil at this, because it has “frame” in the name, but iframes do not have _all_ of the problems that frames do. For instance, the URL of your page will work like you expect.

If you refuse to use frames and iframes, there’s no way to do it with straight-up HTML, but of course, lots and lots of people do it with server-side includes.

---

<div class="post-metadata">

**Author:** ![Balthisar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/balthisar/32/2825_2.png) [@Balthisar](https://boards.straightdope.com/u/Balthisar)\
**Post date:** [February 22, 2004, 1:35am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/4 "2004-02-22T01:35:38Z")

</div>

iFrames are more evil than frames! Ach! BAD-BAD-BAD!!!

Frames? I don’t care. They work.

Aside from server side includes, there are PHP includes. This is strictly speaking a server side include, but using PHP.

---

<div class="post-metadata">

**Author:** ![GuanoLad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/guanolad/32/42_2.png) [@GuanoLad](https://boards.straightdope.com/u/GuanoLad)\
**Post date:** [February 22, 2004, 2:49am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/5 "2004-02-22T02:49:18Z")

</div>

Don’t use an iframe for a menu! Argh! I don’t think they show up at all in some versions of Netscape, and it may be worse even than that.

Use Server Side Includes (SSI) as suggested by Kinthalis, but these have to be set up as a special feature on your webhost server. It shouldn’t be too difficult to arrange.

I have to have the same menu colour-coordinated on several different sections of my site, so I use Includes for the non-colour-dependent sections and that way I only need to change one text file to adjust every menu on the site.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 22, 2004, 3:01am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/6 "2004-02-22T03:01:17Z")

</div>

> [@GuanoLad](#):
>
> Don’t use an iframe for a menu! Argh! I don’t think they show up at all in some versions of Netscape, and it may be worse even than that.

Cite? I’ve never heard that.

Really, I have no big thing for iframes. I’ve never even used them. But they _are_ standard HTML, and they do what you want. I also remember now that the OBJECT tag allows you to do what you want. [Here’s the HTML 4.01 411 on embedding documents](http://www.w3.org/TR/html401/struct/objects.html#embedded-documents).

---

<div class="post-metadata">

**Author:** ![rexnervous](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rexnervous](https://boards.straightdope.com/u/rexnervous)\
**Post date:** [February 22, 2004, 3:33am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/7 "2004-02-22T03:33:40Z")

</div>

I’m not really a webdesigner, but I’m sure you could do it with javascript or php (like Balthasar mentioned).

---

<div class="post-metadata">

**Author:** ![GuanoLad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/guanolad/32/42_2.png) [@GuanoLad](https://boards.straightdope.com/u/GuanoLad)\
**Post date:** [February 22, 2004, 4:20am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/8 "2004-02-22T04:20:24Z")

</div>

> [@Achernar](#):
>
> Cite? I’ve never heard that…

I don’t have a cite, it was through practical experience. But it was about 18 months ago that we tried it, and now I can’t remember if it was actually Netscape that was the problem. It may have been another browser.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 22, 2004, 4:36am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/9 "2004-02-22T04:36:29Z")

</div>

Okay, that’s fine. I’m just saying it’s possible the iframe wasn’t the problem. That happens a lot with HTML. You can’t get something to work in a browser, and it turns out to be something you totally didn’t expect. Anyway, if I were the OP, I would consider the following solutions in the following order:  
[ul]  
[li]Server-side includes (including ASP or PHP)[/li][li]Copying and pasting it yourself (what I did)[/li][li]Iframes[/li][li]Objects[/li][li]Frames[/li][li]Javascript (not generally bad, but certainly not ideal for this application)[/li][/ul]

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [February 22, 2004, 4:53am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/10 "2004-02-22T04:53:13Z")

</div>

> [@Tusculan](#):
>
> I can of course simply copy the content for the menu items into every page, but if I want to modify the links this will become a hassle.

Most good programmer-type editors (not text editors) can do global changes across a whole set of files, so this isn’t really that much of a hassle anymore.

And do whatever it takes to avoid _frames_.

---

<div class="post-metadata">

**Author:** ![Tusculan](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Tusculan](https://boards.straightdope.com/u/Tusculan)\
**Post date:** [February 22, 2004, 9:02am UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/11 "2004-02-22T09:02:31Z")

</div>

Thanks for all the tips.

I’ll check out that Server Side Include/PHP thingy. I’ve seen the term before, but didn’t know what it could do.

Maybe I’ll also follow **t-bonham** ’s advice and shell out real money for a real editor. Up to now I kept working with Notepad; I’m one of those people who started programming in hex and has an innate distrust of the quality of code of automated tools. However, I see this could save a lot of time if I have to make many changes in the future.

Thanks again, all of you.

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [February 22, 2004, 7:46pm UTC](https://boards.straightdope.com/t/html-css-standard-menu-items-without-frames/230426/12 "2004-02-22T19:46:24Z")

</div>

> [@Tusculan](#):
>
> Maybe I’ll also follow **t-bonham** ’s advice and shell out real money for a real editor. Up to now I kept working with Notepad; I’m one of those people who started programming in hex and has an innate distrust of the quality of code of automated tools. However, I see this could save a lot of time if I have to make many changes in the future.
> 
> Thanks again, all of you.

NoteTab is an excellent text editor designed to help create web pages. It’s dirt cheap. So is Ultra-Edit.

You could move up to Homesite for one of the best HTML code editors. At that point, why not go for Dreamweaver down the road.

FYI - Server-side includes (SSIs) and PHP are mutually exclusive. Neither requires the other. However, when used together, your site can rock.
