0

My girlfriend is making a website for her exam.

She is not good at HTML - at all! (Me neither). But for making it easy for her, I told her to use frames. It's easy and manageable.

But the problem is that the website have to live up to the standard HMTL5. That's a requirement. I don't think frames does that because it's deprecated. Am I right or wrong?

So.. What to do? It has to be as simple as possible. I don't think the other solutions I could find are something she can do herself :( Any ideas?

(Sorry, if my english sucks :) )

  • The evolution of StackOverflow - people used to ask questions about their homework, in the strange bold future, people ask questions about other peoples homework. –  Jan 08 '14 at 10:59
  • possible duplicate of [What are the new frames?](http://stackoverflow.com/questions/9466265/what-are-the-new-frames) – Quentin Jan 08 '14 at 10:59
  • @LegoStormtroopr this is not a question about homework, it's a question about whether it's okay to use frames. Although it may be a duplicate, this is definitely appropriate StackOverflow material. – Robin Winslow Jan 08 '14 at 11:39
  • Lego Stormtroopr - I really can't see the problem. You have to explain it for me. I ask StackOverflow a question and I'm just honest what it's for. How is it more correct that she ask? It's a question and I'm quite sure it won't be any different if she asks. – user3172695 Jan 08 '14 at 16:26

3 Answers3

1

You should definitely try not to use deprecated elements. They will behave inconsistently, and probably won't work in the future. There's also a very good reason why frames are deprecated.

You probably need to rethink how you're structuring your data. An HTML page should be as simple and to-the-point as possible. If you have to pull in a significant amount of content from other web-pages using frames, you're doing it wrong. In most cases it's better to simply link to the extra content.

If you're trying to use frames to pull in the <header> or the <nav>, so you don't have to simply copy them across multiple pages, although I applaud you for trying to be DRY, this is the wrong way to do it. Just copying these sections into all your documents is a better solution than using frames.

Ideally though, you'd use a server-side templating system of some sort. The simplest one (depending on your setup) may be Server-Side Includes.

Having said all that, if you really need frames, the <iframe> element is perfectly valid in HTML5 and may help you out.

Community
  • 1
  • 1
Robin Winslow
  • 10,908
  • 8
  • 62
  • 91
  • Yes, that was my point. To be DRY. But I can see that frames is not the right way to do it. I'll tell her to copy paste instead ;) – user3172695 Jan 08 '14 at 11:01
  • @user3172695 you could just try dropping an SSI tag into your document to see if they're enabled on your server, e.g.: ``. It might just work, and would give you a pretty good DRY solution. – Robin Winslow Jan 08 '14 at 11:09
  • You mean to load a CCS document, so she doesn't have to copy paste all the CCS? – user3172695 Jan 08 '14 at 11:27
  • Oh wow. Is she including shared [CSS](http://en.wikipedia.org/wiki/Css) in each document? That's wrong. She should put `` in each document and keep all her CSS in the shared `global.css` file. ([`` element reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)) – Robin Winslow Jan 08 '14 at 11:28
  • No I meant, she may be able to put the menu HTML (hopefully using the [` – Robin Winslow Jan 08 '14 at 11:29
  • Wow, can she do that? So she can make a HTML page, Menu.html, just like you do with frames and type in: in – user3172695 Jan 08 '14 at 12:21
  • @user3172695 She can if the server supports SSI. Apache, nginx, lighttpd and IIS do, among others. Give it a try. It may work, it may not. If it works, that's her best solution. If it doesn't work she may be able to get her hosting company to enable it for her. – Robin Winslow Jan 08 '14 at 12:30
  • @user3172695 re-reading your last comment, you've got several things wrong. Firstly you need to name the `include file=` the same as you name the file - ``. Secondly, this has nothing to do with the [` – Robin Winslow Jan 08 '14 at 12:37
  • @user3172695 actually if it's for homework, the files might be being opened directly in the browser, in which case SSI won't work at all. SSI will only work if your files are being served by a server. – Robin Winslow Jan 08 '14 at 13:58
  • They upload to a server, so I think it support SSI. We'll give it a try. But this line "" I put it in: And this: "" In – user3172695 Jan 08 '14 at 15:09
  • Nope that's wrong. The `` *replaces* the ` – Robin Winslow Jan 08 '14 at 15:22
  • Thanks, Robin. It's a big help. We'll try this out tomorrow and I'll see if we're able to do it. Hehe :P But why is it I wan't to include the entiere ? Just to be DRY? :) – user3172695 Jan 08 '14 at 16:36
  • Yes. Everything that is going to be repeated across every page should be included from a shared file. This usually means you have a top include file that includes the `` open tag, the whole `

    `, the opening `

    ` tag and probably the `
    `, and a bottom include file that includes `
    ...
    `
    – Robin Winslow Jan 08 '14 at 16:46
0

Don't use frames, very old and not needed at all

Make sure all your style stuff is made in CSS and it's loaded through a CSS file.

Then make each html page with the information needed in it. Use links for navigation to another page.

With the external CSS you can change the look of your site in one file (the CSS file), and it will automatic update for each html page.

Jannes
  • 29
  • 9
  • They use CSS, but they don't load from file. They copy paste. I don't know why but I would say it's easier to use frames instead of copy paste the entire menu to all the pages. – user3172695 Jan 08 '14 at 10:51
  • Load it from one file, saves you a lot of time copy pasting. Just use a list of links for the menus, you should copy paste that. Not that much work ;) Clean, simple HTML without frames. – Jannes Jan 08 '14 at 15:33
0

You are correct in assuming that frames do not conform to the HTML5 draft (to the extent that it makes sense to speak of conformance to a draft). HTML5 is not a standard, though it may one day become W3C Recommendation. It does not use the term “deprecated” but “obsolete” and “non-conforming”, but in any case, frameset and frame elements do not conform.

The iframe element (“inline frame”) conforms, however. Using it instead of “normal” (old-style) frames is clumsy and limited, but possible to some extent.

I think this answers the specific, on-topic questions asked. The rest is mainly opinion-based and hence off-topic at SO.

P.S. If “living up the the standard HTML5” is a requirement, then the teachers would need a crash course on the basics of HTML5 process. The requirement means that a page that is “standard HTML5” in the morning may become non-conforming before lunch. After all, HTML5 is a draft that may change at any moment without prior notice, and it says itself: “It is inappropriate to cite this document as other than work in progress.”

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
  • Yes, the iframe element doesn't live up to what we/she wants :( We'll skip the frames and try the other thing :) – user3172695 Jan 08 '14 at 12:18