2009-04-06 8 views
7

Mi piacerebbe avere due frame senza spazio tra loro. Ecco il mio banco di prova:Come posso creare due frame senza spazio tra loro?

<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 è solo:

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

Quando mi rendo questo, però, ottengo una linea bianca tra i due telai. Come posso farlo andare via?

risposta

-3

Ecco un esempio di codice di lavoro che ho utilizzato in passato senza linea bianca.

<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

Questo non è un codice valido. Dovrebbero essere chiusi i tag 'frame' e' frameset'. Sembra anche che il bit "Questa pagina usa i frame ..." dovrebbe essere all'interno di un tag 'noframes'. –

9

È necessario specificare la proprietà FrameBorder nel tag Frameset. Quindi, la pagina principale sarà simile a questa:

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

Questo risolverà il vostro problema.

0

Aggiungi bordo = 0 al tag del set di frame.

+0

Ho avuto quella risposta 5 minuti fa ... ma incollare il codice nella casella di risposta ha completamente rovinato il rendering della pagina in 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 = no è molto importante.

0

È sempre preferibile utilizzare gli stili CSS anziché gli attributi frameborder.

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

Meglio usare iframe e div dove mai possibile.

Ulteriori set di frame non è supportato in HTML5.

Problemi correlati