Frames not working in HTML - html

I am learning HTML and was creating frames which is not working for me. not sure why, below is my code, Please suggest on reason why it is not working. Browser renders me a blank page.
HTML :
<!DOCTYPE html>
<html>
<head>
<title>
Frames
</title>
</head>
<body>
<frameset cols="25%,75%">
<frame src="Links.html" name="links"/>
<frame src="Main.html" name="content"/>
</frameset>
</body>
</html>
Links HTML
<!DOCTYPE html>
<html>
<head>
<title>
Links
</title>
</head>
<body>
<h3>Links</h3>
<ul style="link-style-type:square">
<li> Home</li>
<li> Contact us</li>
</ul>
<h3>Search</h3>
<ul style="link-style-type:square">
<li> Google.com</li>
</ul>
</body>
</html>
Main.HTML
<!DOCTYPE html>
<html>
<head>
<title>
Main
</title>
</head>
<body>
<h3 align="center">Welcome to Foddies</h3>
<p>
-: About us :-
Established in 2015. We are a leading food chain spread in 23 countries with all type of cusines :)
</body>
</html>

This is because frameset must not be inside body tags.
see this w3 recommendation.
change your code to this:
<!DOCTYPE html>
<html>
<head>
<title>
Frames
</title>
</head>
<frameset cols="25%,75%">
<frame src="Links.html" name="links"/>
<frame src="Main.html" name="content"/>
</frameset>
</html>
Also as suggested here, frame is now deprecated.

The frame tag is depricated and the functionality is removed from most browsers.
Edit: I would suggest using an iframe instead.

To use frames on a page use <frameset> tag only instead of <body>
tag.
Also Frames are deprecated in HTML, I would rather suggest go for iFrame tags.

Related

My iframe is saying The connection was reset

Any ideas? this is the code I'm using currently.
<!DOCTYPE HTML>
<HTML>
<head>
</head>
<body>
<iframe src='https://www.wallgle.com'></iframe>
</body>
</html>

Hide "!DOCTYPE html" in iframe

We managed to embed a html-table with iframe. At the very top of the table you can read "!DOCTYTE html". What do I have to include in the iframe-command that this "!DOCTYTE html" doesn't show up anymore?
My code so far:
<iframe src="http://test/positiveFaelle.html" scrolling="no" seamless="seamless" frameBorder="0" width="900" height="485"></iframe>
The result:
It's a problem with your test/positiveFaelle.html file.
The content should look something like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Title</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
If in your file you have <!DOCTYPE html> it wont work.
Hope this helped.

Links are not opening properly in the bottom frame

I am working with frames for the first time. Here is
index.html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<frameset rows="20%,*">
<frame name="top" src="top.html" name="topmenu" />
<frame name="main" src="content.html" name="content" />
<noframes>
<body>
Your browser does not support frames.
</body>
</noframes>
</frameset>
</html>
top.html
<html>
<head></head>
<body>
<div id="container">
<!-- begin navigation -->
<nav id="navigation">
<ul>
<li>Contact</li>
</ul>
</nav>
<!-- end navigation -->
</div>
</body>
</html>
content.html
<html>
<head></head>
<body>
Some Content
</body>
<html>
contact.html
<html>
<head></head>
<body>
Contact page
</body>
<html>
With this, the output is as under
Now when I click on the Contact link, instead of displaying the content in the content.html, it opens in a new tab as under
What is the mistake I am making. I believe there is some problem from my side in choosing the proper target.
Frames are not supported in HTML5 ^, it is deprecated, and to get it working the <!DOCTYPE> must be set to either HTML Frameset DTD or XHTML Frameset DTD.
If you check the HTML setting in this jsFiddle you'll see that I had set the DOCTYPE to "HTML 4.01 Frameset" in order to make it works, as in this image:
** Also Note that you have used the name attribute twice in each frame tag and there should be only one!
<frame name="top" src="top.html" name="topmenu" />
<frame name="main" src="content.html" name="content" />
^ Sources:
https://developer.mozilla.org/en/docs/Web/HTML/Element/frame
http://www.w3schools.com/tags/tag_frame.asp

Link not working with frame tag in html

I need 3 pages merged in one single page with frame tag so I used a frametag with the src attribute but its not working, is frame tag now obsolete or is it just me?
Here's the code
<html>
<style ="text/css"> </style>
<frameset cols="33.3%,33.3%,33.3%">
<frame src="1.html">
<p>hello</p>
<frame>
<p>productivity</p>
</frame>
<frame>
<p> Entertainment</p>
</frameset>
All the frame pages should follow these mandatory rules:
Page containing <frameset> should not include <html> and/or <body> tags.
The <frame> tags must be close using either <frame></frame> or <frame />.
The <frame> tags must have an 'src' attribute and without src attribute, the space allocated for it will be displayed as a blank page.
For your need the following will be the required answer:
Frame.html
<frameset cols="33.3%,33.3%,33.3%">
<frame src="1.html" />
<frame src="2.html" />
<frame src="3.html" />
</frameset>
1.html
<html>
<body>
<p>Hello</p>
</body>
</html>
2.html
<html>
<body>
<p>Productivity</p>
</body>
</html>
3.html
<html>
<body>
<p>Entertainment</p>
</body>
</html>

Frameset not displaying

I got this exercise I have to make involving framesets. I've created this html:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<frameset rows="50%,50%" cols="50%,50%">
<frame src="../../topleft.html" name="topleft">
<frame src="topright.html" name="topright">
<frame src="botleft.html" name="botleft">
<frameset rows="50%,50%">
<frameset cols="50%,50%">
<frame src="brtl.html" name="brtl">
<frame src="brtr.html" name="brtr">
</frameset>
<frame src="botrbot.html" name="botrbot">
</frameset>
</frameset>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>topleft.html</title>
</head>
<body>
topleft
</body>
</html>
All the other html's are identical to topleft.html and therefor I've not included them. Nothing is showing in my browser. What am I doing wrong?
if you are using frameset there is no use of body, so just remove the <body> and </body>.
if you want the browser to display something when no frames are supported follow this link.
Frameset tag can't use the body, so just remove tag after try comes to output.