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?
Related
The layout i want to make
I dont know how to get the frames to layout in the right position I want, so I could use help.
That is done using frameset. I have added frameborder="1"which will show the border, you can set it to "0" or remove the borders. You can change the border size by adding border="1px". And add bordercolor:#000; for adding colors to the border. And for scrolling you can use scrolling="Yes/No/Auto" in the frameset beggining tag.The code given below will not work on Stack Overflow, Codepen,or JSFiddle as <frameset> is no longer supported in HTML5. But you can save the file locally or try it on W3Schools by pasting the following code, and it will work.Edit the frame sources, else it will not work (as I have given invald pages).
<html>
<frameset frameborder="1" rows="20%, 80%"><!--set frameborder value "0" for hiding the borders -->
<frame src="https://via.placeholder.com/1000X150/181818/FFFFFF/?text=20%">
<frameset cols="25%, 75%">
<frame src="https://via.placeholder.com/150X500/181818/FFFFFF/?text=25%">
<frameset rows="50%, 50%">
<frame src="https://via.placeholder.com/700X250/181818/FFFFFF/?text=75%">
<frameset cols="75%, 25%">
<frame src="https://via.placeholder.com/600X200/181818/FFFFFF/?text=50%">
<frame src="https://via.placeholder.com/200/181818/FFFFFF/?text=25%">
</frameset>
</html>
<!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.
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.
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.
Google Images is the best example. Once you follow an image, a frame remains at the top of the page, always reminding you to return to Google. Does this technique have a special name and what is the most efficient way to do this?
I have this so far:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Framed content</title>
<style type="text/css">
#bar {
width:100%;
height:10%;
}
iframe {
width:100%;
height:90%;
}
</style>
</head>
<body>
<div id="bar"><!-- PUT THE CONTENTS OF THE BAR HERE --></div>
<iframe src="{LOCATION OF THE HTML PAGE}"></iframe>
</body>
</html>
How can I adapt the above so that #bar can read 100px high rather than 10% high? How does that affect the code? This is the crux of my question.
Many thanks. Patrick
I think it's still just called 'framing' even if it's more advanced than the old frameset style popular in the late '90s and early 2000s. Other examples you could study include Facebook and Stumbleupon.
You could do what google does, and remove your doctype tag. your markup will pretty much work right away with this one modification, and you'll be able to set the bar's height to 100px, and the iFrame's height to 100% -- producing the desired results.
I've seen it called a "topbar"...
Personally, though, I find them really annoying unless they're serving a very useful purpose. I don't need to be reminded to go back to your website. You might as well just open the link in a new window at that point.
After a bit of investigation, I came across this, which doesn't use iframes at all. I know some people won't touch framesets with a bargepole, but I'd be interested to know what people think could be potential problems, other than the obvious "frames not supported".
<html>
<frameset rows="100,*" frameborder="no" framespacing="0">
<frame name="h" src="top_source" scrolling="no" noresize >
<frame name="t" src="main_source" scrolling="auto" noresize >
</frameset>
</html>
This makes use of the wildcard " * ", which div height attributes don't have.