2010-10-22 77 views
1
<html> 
<link rel="stylesheet" type="text/css" media="screen" href="blogstyle.css"> 
    <title>Welcome to my blog</title> 

    <body> 
     <frameset cols="10%,60%,30%" border="0" framespacing="5" frameborder="0"> 
     <frame src="leftpane.htm" name="left_frame" scrolling="no" /> 
     <frame src="middlepane.htm" name="middle_frame" scrolling="no" /> 
     <frame src="rightpane.htm" name="right_frame" scrolling="no" /> 
     </frameset> 




    </body> 
</html> 

文件leftpane.html包含下面的代碼:爲什麼這些代碼不可見?

<link rel="stylesheet" type="text/css" media="screen" href="blogstyle.css"> 
<html lang="en"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <title></title> 
    <meta name="generator" content="Studio 3 http://aptana.com/"> 
    <meta name="author" content="RP"> 
    <!-- Date: 2010-10-22 --> 
</head> 
<body> 
     <div id="PhotoBox-Outline" style = "top: 50px; left: 50px"> 
      <div id="PhotoBox" class="shadow" style = "top: 20px; left: 20px"> 
      </div> 
     </div> 

     <div id="PhotoBox-Outline" style = "top: 280px; left: 50px"> 
      <div id="PhotoBox" class="shadow" style = "top: 20px; left: 20px"> 
      </div> 
     </div> 
</body> 
</html> 

相同的代碼進行工作時,上面的div是第一個代碼,當我還沒有定義的框架。

回答

2

當您使用frameset時,您可以使用它而不是body。只需在主html文件中刪除您的body和/ body標籤即可。

http://www.w3.org/TR/html4/present/frames.html

「A標準文檔具有一個頭部部分和一個主體。框架集文件具有頭部,並且代替所述主體的FRAMESET」。

1

在具有幀的第一個示例中;

<link rel="stylesheet" type="text/css" media="screen" href="blogstyle.css"> 
    <title>Welcome to my blog</title> 

應該看起來像;

<head> 
<link rel="stylesheet" type="text/css" media="screen" href="blogstyle.css"> 
<title>Welcome to my blog</title> 
</head> 

同樣在左側窗格中;

<link rel="stylesheet" type="text/css" media="screen" href="blogstyle.css"> 
<html lang="en"> 
<head> 

我認爲最好的做法是將樣式表放在head標籤內;

<html lang="en"> 
<head> 
<link rel="stylesheet" type="text/css" media="screen" href="blogstyle.css"> 

查看http://www.w3.org/TR/html401/struct/links.html舉例。

+0

仍然無法正常工作。 – RKh 2010-10-22 17:27:13