2009-04-06 11 views
7

Chciałbym mieć dwie ramki bez spacji między nimi. Oto mój przypadek testowy:Jak utworzyć dwie ramki bez spacji między nimi?

<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 tylko:

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

Kiedy czynią to jednak, dostaję białej linii pomiędzy dwoma klatkami. Jak mogę to zrobić?

Odpowiedz

-3

Oto przykład działającego kodu, którego używałem w przeszłości, który nie ma białej linii.

<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> 
+0

To nie jest prawidłowe oznaczenie. Powinny być zamykane znaczniki 'frame' i' frameset'. Wygląda również na to, że bit "Ta strona używa ramek ..." powinien znajdować się wewnątrz znaczników 'noframes'. –

9

Musisz określić właściwość FrameBorder w tagu Frameset. Więc stronie głównej będzie wyglądać następująco:

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

to rozwiąże problem.

0

Dodaj border = 0 do tagu zestawu ramek.

+0

Miałem tę odpowiedź 5 minut temu ... ale wklejenie kodu do pola odpowiedzi całkowicie przekręciło renderowanie strony w chrome. – alumb

1
<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 = nie jest bardzo ważne.

0

Zawsze preferuje się używanie stylów CSS zamiast atrybutów frameborder.

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

Lepiej używać elementu iframe i div, gdy jest to możliwe.

Kolejny zestaw ramek nie jest obsługiwany w HTML5.

Powiązane problemy