Frames not working in HTML5 - html

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>

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.

Related

Cant see split html file

I'm trying to split html file into 2 different files:
<html>
<head>
</head>
<body>
<frameset cols="25%,75%">
<frame src="addNewEvent.html" />
<frame src="totalEvents.html" />
</frameset>
</body>
</html>
addNewEvent.html:
<html>
<head>
</head>
<body>
Left
</body>
</html>
totalEvents.html:
<html>
<head>
</head>
<body>
Right
</body>
</html>
The 3 files (main html and addNewEvent.html, totalEvents.html) are in the same directory.
(I just learning html, so for now, I'm not using server, and open the main page with the browser.
When opening the main page in the browser, is seems that the addNewEvent.html, totalEvents.html are not loaded. (There is no error in console log)
What an I doing wrong ?
Is it right to split the page into little pages with frameset ?
What an I doing wrong ?
You didn't use a validator which would have told you that a <frameset> element is not allowed inside a <body> element.
Frameset documents have a <frameset> instead of a <body> element. Since the HTML document already had its own <body>, the browser ignored the <frameset>.
Is it right to split the page into little pages with frameset ?
That's largely a matter of opinion. They do cause various issues with how they interact with browser navigation controls and do not exist in HTML 5.

Frameset do not work in rails 4.2

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title> ABC </title>
</head>
This is index.html.erb
<frameset rows="170,*" frameborder="0" border="0" framespacing="0">
<frame name="topNav" src="top_nav.html" />
</frameset>
</html>
My layout is false for this view. So, html, head is declared at this view only. Question is why does not this code work in erb files?
I see only "This is index.html.erb" message on the page.
I hope everyone know that
framesets
should not come under/after body.
Problem with above code was line:
This is index.html.erb
Browser was converting taking this body tags. Removed this line from code and framesets started to appear.

Multiple CGI scripts in an HTML frameset

I have multiple (3-4) CGI scripts which should be presented on one HTML page.
I tried this:
<html>
<head>
<title>Testing</title>
</head>
<body>
<h1>TESTPAGE<BR></h1>
<frameset cols="35%,20%,*">
<frame src="./cgi-bin/1.cgi">
<frame src="./cgi-bin/2.cgi">
<frame src="./cgi-bin/3.cgi">
</frameset>
</body>
</html>
Only TESTPAGE is shown, no cgi was opened.
Your HTML is invalid. A validator would have told you what the problem was.
You can't have a <frameset> inside a <body>. You use a <frameset> instead of a <body>.
When your browser encounters the <frameset>, it is already rendering a normal HTML body, so it ignores it because it has no place to put it.

how to show html content inside html page

i know i can have iframe in a html page, say parent.htm, and i can have something like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<img alt="http://localhost/images/header.png" src="http://localhost/images/header.png" width=700px height=100px />
<iframe src="Child.htm"></iframe>
</body>
</html>
But can i put html directly into iframe rather than pointing it to a file (child.htm).
Thanks.
No you cant only browsers that do not support frames will show the contents
The information to be inserted inline is designated by the src
attribute of this element. The contents of the IFRAME element, on the
other hand, should only be displayed by user agents that do not
support frames or are configured not to display frames.
From W3C
Use a div, create html into it. Then set a size to the div and use overflow:auto to create scrollbar (like an iframe)

CSS and frameset?

I have an .html document of XHTML 1.0 Frameset doctype and I'm using the following code:
<frameset rows="20%, 80%" border="1">
...
</frameset>
When putting the above .html code in W3C Validator I get the following error:
there is no attribute "border" in frameset.
What can I do, in order to prevent this error? I tried creating a css file with:
frameset {
border: 1px;
}
but didn't seem to work.
Please don't comment/answer telling me how bad frames are (I know by myself).
Short answer, use this instead:
<frameset ...>
<frame frameborder="xx"/>
</frameset>
[see http://www.codingforums.com/archive/index.php/t-10259.html ]
What if you gave your frameset a class and then put the class in the stylesheet?