Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create two frames with no space between them?

Tags:

html

css

I'd like to have two frames with no space between them. Here's 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 is just:

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

When I render this, however, I get a white line between the two frames. How do I make it go away?

like image 947
mike Avatar asked Apr 06 '09 16:04

mike


People also ask

How do I remove the space between two frames in HTML?

Add border=0 to your frameset tag.

How can we create nested frames?

Nested frame setsFramesets may be nested to any level. In the following example, the outer FRAMESET divides the available space into three equal columns. The inner FRAMESET then divides the second area into two rows of unequal height.

How do you put a space between frames?

Set the body and html margins to 0 within the frame_#. html files and you should be good. Save this answer.

How do you divide frames?

The <frameset> tag defines, how to divide the window into frames. The rows attribute of <frameset> tag defines horizontal frames and cols attribute defines vertical frames. Each frame is indicated by <frame> tag and it defines which HTML document shall open into the frame. Note − The <frame> tag deprecated in HTML5.


2 Answers

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.

like image 146
jgallant Avatar answered Oct 12 '22 16:10

jgallant


<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.

like image 28
huangli Avatar answered Oct 12 '22 15:10

huangli