PDA

View Full Version : Frameset Width, Height, and Border



Rain Lover
Mar 8th, 2010, 05:51 PM
Hi everyone,

How can I set a fixed width and height for the whole frameset:


<html>

<frameset cols="25%,50%,25%">

<frame src="http://www.w3schools.com/html/frame_a.htm">
<frame src="http://www.w3schools.com/html/frame_b.htm">
<frame src="http://www.w3schools.com/html/frame_c.htm">

</frameset>

</html>

I'd like the frameset to be just 400 x 200 px. But when I insert the above code it covers my whole webpage.
Also I'd like to put a border around the frameset.


Your help is really appreciated!

Regards
Rain Lover

VIPStephan
Mar 8th, 2010, 07:58 PM
How about putting absolute size values instead of relative ones?
You’ll probably have to create a fixed frame and then have another empty frame take the remaining space. And using a search engine will most likely answer your question about a frame border.

A quick search brings this, for example: http://www.w3.org/TR/REC-html40/present/frames.html#h-16.2.1

Rain Lover
Mar 8th, 2010, 08:36 PM
I tried <frameset cols="100px, 200px, 100px"> too, but it doesn't work either.

VIPStephan
Mar 8th, 2010, 08:37 PM
Then read the page I linked to. In HTML you don’t use units, it defaults to pixels.

Rain Lover
Mar 8th, 2010, 08:44 PM
Thanks for the reference, but I've already seen it.



In HTML you don’t use units, it defaults to pixels.

I've tried with and without px.
I'd be so grateful if you gave the above code a try on a web page and made a practical change in the final result.

ckeyrouz
Mar 8th, 2010, 09:27 PM
I don't know what is the width of your screen but I think it is bit more than 400 pixels.
Now look at the sum of the width of the columns in your frameset it is 400 pixels.
The sum should be at least the width of the screen.

I would suggest to replace this:

<frameset cols="25%,50%,25%">


with this:

<frameset cols="100,200,*">


This way the first column will be 100 pixels in width, the second 200 pixels and the third will occupy the remaining space in the screen.

Rain Lover
Mar 8th, 2010, 09:44 PM
This way the first column will be 100 pixels in width, the second 200 pixels and the third will occupy the remaining space in the screen.

Thanks for the answer, but the point is I don't want it to cover the whole screen:

http://mori79.webs.com/frameset.htm

ckeyrouz
Mar 8th, 2010, 09:51 PM
then you can add a fourth column (blank) that will occupy the remaining space like this:


<html>
<frameset cols="100,200,100,*">
<frame src="http://www.w3schools.com/html/frame_a.htm">
<frame src="http://www.w3schools.com/html/frame_b.htm">
<frame src="http://www.w3schools.com/html/frame_c.htm">
<frame src="about:blank">
</frameset>
</html>

Rain Lover
Mar 8th, 2010, 10:08 PM
No good: the white blank part covers the rest of the page and doesn't let me put other elements/text next to the frameset.

ckeyrouz
Mar 8th, 2010, 10:11 PM
instead of the blank:html you can put an html containing the following tags:



<html>
<body>
<div id="result"></div>
</body>
</html>


and load it in the fourth frame and this way you can put anything inside the div.

I do not know if this is what you need.

VIPStephan
Mar 8th, 2010, 11:50 PM
No good: the white blank part covers the rest of the page and doesn't let me put other elements/text next to the frameset.

OK, it seems like thereís basic misconception about framesets. A frameset is replacing the regular HTML body element, and hence, you canít have a frameset and then put other stuff next to it. A frameset is always using the space of the viewport in its entirety. You may have better luck by using an inline frame (a. k. a. iframe). But anyway, to give you the best advice it would help if you told us what your intention is.