How to create two frames without spaces between them?

I would like to have two frames with no spaces between them. Here is my test case:

<html> <frameset framespacing="0" rows="50%, 50%"> <frame frameborder="0" src="red.html" scrolling="no" noresize="1" /> <frame frameborder="0" src="red.html" /> </frameset> </html> 

red.html:

 <html><body bgcolor="red"></body></html> 

When I do this, I get a white line between two frames. How am I supposed to leave this?

+7
html css
source share
5 answers

Here is an example of working code that I used in the past that does not have a white line.

  <frameset rows="10%,*" noresize framespacing=0 frameborder=no border=0 > <frameset cols="140,*" noresize framespacing=0 frameborder=no border=0 > <frame name="globe" scrolling="no" src="./GIF/globe.jpg" marginwidth="0 marginheight="0"> <frame name="logo" src="logo.htm" scrolling="no" > </frameset> <frameset cols="160,*" noresize framespacing=0 frameborder=no border=0 > <frame name="userselections" src="userselections.php" scrolling="auto"> <frame name="results" src="nothing.htm" scrolling="auto"> </frameset> <noframes> <body> <p>This page uses frames, but your browser doesn't support them.</p> </body> </noframes> </frameset> 
-3
source share

You need to specify the FrameBorder property in the Frameset tag. So your main page will look like this:

 <html> <frameset framespacing="0" rows="50%, 50%" frameborder="0"> <frame frameborder="0" src="red.html" scrolling="no" noresize="1" /> <frame frameborder="0" src="red.html" /> </frameset> </html> 

This will solve your problem.

+9
source share
 <html> <frameset framespacing="0" rows="50%, 50%" framespacing="0" frameborder=no> <frame frameborder="0" src="red.html" scrolling="no" noresize="1" /> <frame frameborder="0" src="red.html" /> </frameset> </html> 

frameborder = no is very important.

+1
source share

Add border = 0 to your frameset tag.

0
source share

It is always recommended to use css styles instead of the frameborder attribute.

 <frameset cols="50%,50%"> <frame src="frame_1.htm" style="border:none"> <frame src="frame_2.htm"> </frameset> 

It is better to use iframes and divs where possible.

A further set of frames is not supported in HTML5.

0
source share

All Articles