我正在eclipse中使用Web Tools Platform,它提供了WYIWYG功能。現在我遇到了這個問題,兩個容器不在同一行顯示。真奇怪的是,當我將文件導出到桌面並使用瀏覽器打開它時,兩個容器顯示爲一行,但沒有邊距。爲什麼有兩種不同的外觀?我的意思是,eclipse插件可能無法正常工作,但最遲在瀏覽器中打開文件時,它應顯示我編碼或不編碼的內容?eclipse網頁編輯器:div不在線
這裏是什麼,我想說明兩個畫面:
下面是HTML文件:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="mainStyle2.css" />
<title>title</title>
</head>
<body>
<div id="container">
<div id="header"><b>main title</b></div>
<div id="navigation" style="float:left">
<b>Navigation</b> <br /><hr />
Welcome<br />
Team<br />
Links<br />
Screenshots<br />
</div>
<div id="contCont" style="float:left">
Content
</div>
</div>
</body>
</html>
...和CSS- file:
@CHARSET "ISO-8859-1";
#container{ background-color:#00FF59;
width:1200px;}
#header{ background-color:#99FF99;
text-align:center;
font-family:bookman old style;
font-size:50px;
margin-top:20; margin-bottom:10;
margin-left:20; margin-right:20;}
#navigation{ background-color:#99FF99;
width:200px; height: 800px;
font-family:bookman old style;
font-size:20;
margin-top:10; margin-bottom:10;
margin-left:20; margin-right:20;}
#contCont{ background-color:#99FF99;
width:1000px; height: 800px;
font-family:bookman old style;}
注意:我已在「導航」和「contCont」中用float:left
對其進行了測試,但沒有更改。