質問

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

役に立ちましたか?

解決

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.

他のヒント

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.

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.”

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top