0

I have a task to do and I know that I should not be using frames but I have to. I tried to load 3 html pages into 3 frames on the main page but it's showing absolutely nothing at all. This is the code:

<body>
<h4>BGJUG - Bulgarian Java User Group</h4>
<div class="menu">
    ABOUT EVENTS CONTACTS SEARCH
    <hr width="90%" />
</div>
<frameset cols="25%,50%,25%">
    <frame src="a.html">
    <frame src="b.html">
    <frame src="c.html">
</frameset>
</body>
Lucho Gizdov
  • 99
  • 1
  • 1
  • 8
  • 2
    Are you using HTML5? As per this documentation (http://www.w3schools.com/tags/tag_frameset.asp), the frameset tag has been discontinued. , – cchapman Feb 21 '15 at 17:36
  • 2
    While `frameset` are entirely obsolete in html5, a frameset needs to be a direct child of `html` and is used instead of `body` you might want to use `iframe` instead. – t.niese Feb 21 '15 at 17:38
  • Just in case also see http://stackoverflow.com/questions/18259232/alternative-for-frames-in-html5-using-iframes – Amitd Feb 21 '15 at 18:06
  • thanks, the solution was to put the frameset direct under the html tag. – Lucho Gizdov Feb 21 '15 at 22:35

1 Answers1

0

The <frameset> tag is not supported in HTML5. You will need to change your DOCTYPE to one that supports frames. Try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

Also, see the comment by t.niese about framesets being direct children of <html>.

Alternatively, if you need the HTML5 features, you can accomplish the same thing with <iframe>. inside CSS boxes. Scrolling of <iframe> is also not supported in HTML5 but you can probably put the <iframe> tags in CSS boxes with overflow: scroll;. See the other comment by t.niese below this answer.

Bob Brown
  • 1,463
  • 1
  • 12
  • 25
  • `[...] Scrolling of – t.niese Feb 21 '15 at 17:43
  • @t.niese: I found that here: http://www.w3schools.com/tags/att_iframe_scrolling.asp I realize that's not the most authoritative source in the world, but I'd have expected that one to be corrected quickly if it were wrong. – Bob Brown Feb 21 '15 at 17:45
  • 1
    _w3schools_ still has many inaccuracies that are misleading (like in this case), but they also just say that the `scrolling` attribute is not supported anymore. But you will have to apply `overflow: auto|scroll|visible` to the `iframe` itself and not on a surrounding element, and the use of scrollbars is the default for `iframe`s. – t.niese Feb 21 '15 at 17:53