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
Related
Let's say I have the following HTML files:
header.html
<html>
<head>
<link href="headerstyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>Page Header</div>
</body>
</html>
body.html
<html>
<head>
<script src="body.js"></script>
</head>
<body>
<span>Page Body</span>
</body>
</html>
I want to take these two files and make a master file that would look like this:
<html>
<head>
<link href="headerstyle.css" rel="stylesheet" type="text/css" />
<script src="body.js"></script>
</head>
<body>
<div>Page Header</div>
<span>Page Body</span>
</body>
</html>
How can I go about merging them into one HTML file in Java, maybe using Java (JSoup) or JQuery?
Thank you all in advance.
You can do by <Frameset> Hope you get your needs
<frameset cols="50%,*">
<frameset rows="50%,*">
<frame src="frame_a.htm">
<frame src="frame_c.htm">
</frameset>
<frame src="frame_b.htm">
</frameset>
What is the type of this document.I am confused as it has html 4.0 declaration and also contains xml.
Here is the structure of the document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<TITLE>Container</TITLE>
<LINK href="css/xyz.css" type="text/css" rel="stylesheet">
</head>
<frameset >
<FRAMESET rows="97%,28" border="0" frameBorder="0">
<frame name="main" src="ContainerInner.htm">
<FRAME Name="Statusbar" SRC="html/MainStatusbar.htm">
</FRAMESET>
<noframes>
<p>This page requires frames, but your browser does not support them.</p>
</noframes>
</frameset>
</html>
<!-- ContainerInner.htm -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ContainerInner</title>
</head>
<body>
<IFRAME Name="MainScreen" SRC="html/loading.htm"></IFRAME>
<IFRAME Name="MenuTree" SRC="html/BlankMenu.htm" />
<iframe name="ToolbarScreen1" src="html/FavouriteMenus.htm"></iframe>
<IFRAME name="TaskQueues" src="html\UserInfo.htm"></IFRAME>
</body>
</html>
<!-- html/loading.htm -->
<!-- screen inside IFRAME MainScreen -->
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD></HEAD>
<BODY> </BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
I have following questions:
Is it an XHTML document or HTML.
Is it legal to have multiple doctype declarations like above.
Will latest version of modern browsers like chrome support this document as it has frames.
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>
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.
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.