插入doctype时,不会显示html内容

插入doctype时,不会显示html内容,html,xhtml,dtd,Html,Xhtml,Dtd,我在internet explorer中显示我的html/css文档时遇到问题,它在fire fox和chrome中运行良好,所以我猜这是因为我没有插入任何doctype,当我插入xhtml或html的doctype时,它不工作,它只会显示我的标题部分,我应该为doctype包含什么 我试过这个: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/D

我在internet explorer中显示我的html/css文档时遇到问题,它在fire fox和chrome中运行良好,所以我猜这是因为我没有插入任何doctype,当我插入xhtml或html的doctype时,它不工作,它只会显示我的标题部分,我应该为doctype包含什么

我试过这个:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
        <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

但它不起作用。以下是我的代码:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>bazar</title>
<style type="text/css">

#container {
width: 770px;
margin: 0 auto
}
#main
{
width:100%;
height:100%;
up:0;
bottom:0;
margin:0;
}
#header
{
position:fixed;
background:url(header_slice.png);
repeat x;
width:100%;
height:63px;
top:0;
left:0;
right:0;
}
#logo
{
position:fixed;
background:url(logo.png);
width:192;
height:59;
float:right;
left:900;
}
#mymenu
{
position:fixed;
background:url(menu.png);
width:302;
height:19;
top:30;
left:122.5;
overflow:auto;
}
#mytext
{
position:fixed;
background:url(textbox.png);
width:257;
height:20;
top:30;
left:460;
}
#nav{
position:absolute;
background:url(navigation_slice.jpg);
repeat x;
width:100%;
height:148;
top:63;
z-index:1000;
left:0;
right:0;
}
#mycontainer
{
position:absolute;
background:white;
repeat x;
repeat y;
width:100%;
height:1281;
top:210;
left:0;
right:0;
}
#menu2
{
position:absolute;
background:url(navbar.png);
repeat x;
width:952;
height:67;
top:40;
left:125;
}
#home
{
position:absolute;
background:url(home.png);
width:52;
height:36;
top:30;
left:0;
}
#pencil{
position:absolute;
background:url(pencil.png);
width:39;
height:42;
top:7;
right:23;
}
#archive{
position:absolute;
background:url(archive.png);
width:38;
height:37;
top:7;
right:110;
}
#sep1{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:78;
}
#sep2{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:173;
}
#sep3{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:284;
}
#sep4{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:388;
}
#sep4{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:459;
}
#sep4{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:386;
}
#sep5{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:459;
}
#sep6{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:526;
}
#sep7{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:596;
}
#sep8{
position:absolute;
repeat y;
width:2;
height:67;
top:0;
right:670;
}
.sep{
background:url(sep.png);
}
#seminar
{
position:absolute;
background:url(seminar.png);
right:204;
width:45;
height:33;
top:7;
}
#learn
{
position:absolute;
background:url(learning.png);
right:312;
width:44;
height:36;
top:7;
}
#art{
position:absolute;
background:url(art.png);
width:45;
height:40;
top:5;
right:400;
}
#engineer{
position:absolute;
background:url(engineer.png);
width:54;
height:36;
top:7;
right:470;
}
#publish{
position:absolute;
background:url(publish.png);
width:49;
height:38;
top:7;
right:539;
}
#new{
position:absolute;
background:url(new.png);
width:36;
height:31;
top:7;
right:610;
}
#contact
{
position:absolute;
background:url(contact.png);
width:178;
height:58;
top:17;
right:610;
left:125;
}
#rect1
{
width:716;
height:308;
top:-35;
left:125;
}
#rect2
{
width:226;
height:308;
top:-35;
left:850;
}
.rect
{
position:absolute;
background:url(rect.png);
repeat x;
repeat y;
}
#special
{position:absolute;
background:url(special.png);
width:696;
height:255;
top:-30;
left:132;
z-index:1000;
}
#chasb
{
position:absolute;
background:url(chasb.png);
width:56;
height:62;
top:50;
right:300;
z-index:1000;
}


#takhte
{
position:absolute;
background:url(takhte.png);
width:51;
height:58;
top:170;
right:300;
z-index:1000;
}
#sabad1{
position:absolute;
width:80;
height:17;
top:210;
right:370;
z-index:1000;
}
#sabad2{
position:absolute;
width:80;
height:17;
top:90;
right:370;
z-index:1000;
}
.sabad
{
background:url(sabad.png);
}

#left
{
position:absolute;
background:url(slideleft.png);
top:280;
left:125;
width:20;
height:69;
z-index:2000;
}
#right
{
position:absolute;
background:url(slideright.png);
top:280;
left:822;
width:17;
height:69;
z-index:2000;
}
#slide
{
position:absolute;
top:280;
left:125;
width:716;
height:69;
z-index:1500;
}
#staff
{
position:absolute;
background:url(staff.png);
width:228;
height:70;
top:280;
z-index:1000;
left:850;
}
#mybox
{
position:absolute;
background-color: white;
top:0;
left:865;
width:200;
height:260;
z-index:900;
}
#product
{
position:absolute;
background:url(products.png);
width:200;
height:76;
top:-30;
left:865;
z-index:1000;
}
</style>
</head>
<body>
<div id='main'>
<div id='header'>
<div id='logo'></div>
<div id='mymenu'></div>
<div id='mytext'></div>
<div id='nav'>
<div id='menu2'>
        <div id='home'></div><div id="pencil"></div>
        <div id="sep1" class="sep"></div><div id="archive"></div>
        <div id="sep2" class="sep"></div><div id="seminar"></div>
        <div id="sep3" class="sep"></div><div id="learn"></div>
        <div id="sep4" class="sep"></div><div id="art"></div>
        <div id="sep5" class="sep"></div><div id="engineer"></div>
        <div id="sep6" class="sep"></div><div id="publish"></div>
        <div id="sep7" class="sep"></div><div id="new"></div><div id="sep8" class="sep"></div>
</div>
<div id='contact'></div>
</div>

</div>

<div id='mycontainer'>

<div id='rect1' class='rect'></div>
<div id='rect2' class='rect'></div>
<div id='special'></div>
<div id='chasb'></div><div id='takhte'></div><div id='sabad1' class="sabad"></div><div id='sabad2' class="sabad"></div>
<div id='mybox'></div>
<div id='product'></div>
<div id='staff'></div>
<div id='slide' class="rect"></div>
<div id='left'></div><div id='right'></div>
</div>

</div>

</body>
</html>

巴扎
#容器{
宽度:770px;
保证金:0自动
}
#主要
{
宽度:100%;
身高:100%;
上升:0;
底部:0;
保证金:0;
}
#标题
{
位置:固定;
背景:url(header_slice.png);
重复x;
宽度:100%;
高度:63px;
排名:0;
左:0;
右:0;
}
#标志
{
位置:固定;
背景:url(logo.png);
宽度:192;
身高:59;
浮动:对;
左:900;
}
#我的菜单
{
位置:固定;
背景:url(menu.png);
宽度:302;
身高:19岁;
前30名;
左:122.5;
溢出:自动;
}
#我的文本
{
位置:固定;
背景:url(textbox.png);
宽度:257;
身高:20;
前30名;
左:460;
}
#导航{
位置:绝对位置;
背景:url(navigation_slice.jpg);
重复x;
宽度:100%;
身高:148;
排名前63名;
z指数:1000;
左:0;
右:0;
}
#霉菌容器
{
位置:绝对位置;
背景:白色;
重复x;
重复y;
宽度:100%;
身高:1281;
排名前210名;
左:0;
右:0;
}
#菜单2
{
位置:绝对位置;
背景:url(navbar.png);
重复x;
宽度:952;
身高:67;
排名前40名;
左:125;
}
#家
{
位置:绝对位置;
背景:url(home.png);
宽度:52;
身高:36;
前30名;
左:0;
}
#铅笔{
位置:绝对位置;
背景:url(pencil.png);
宽度:39;
身高:42;
前7名;
右:23;
}
#档案馆{
位置:绝对位置;
背景:url(archive.png);
宽度:38;
身高:37;
前7名;
右:110;
}
#九月一日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:78;
}
#九月二日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:173;
}
#九月三日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:284;
}
#九月四日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:388;
}
#九月四日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:459;
}
#九月四日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:386;
}
#九月五日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:459;
}
#九月六日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:526;
}
#九月七日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:596;
}
#九月八日{
位置:绝对位置;
重复y;
宽度:2;
身高:67;
排名:0;
右:670;
}
九月{
背景:url(sep.png);
}
#研讨会
{
位置:绝对位置;
背景:url(seminar.png);
右:204;
宽度:45;
身高:33;
前7名;
}
#学习
{
位置:绝对位置;
背景:url(learning.png);
右:312;
宽度:44;
身高:36;
前7名;
}
#艺术{
位置:绝对位置;
背景:url(art.png);
宽度:45;
身高:40;
排名前5名;
右:400 ;;
}
#工程师{
位置:绝对位置;
背景:url(engineer.png);
宽度:54;
身高:36;
前7名;
右:470;
}
#发表{
位置:绝对位置;
背景:url(publish.png);
宽度:49;
身高:38;
前7名;
右:539;
}
#新的{
位置:绝对位置;
背景:url(new.png);
宽度:36;
身高:31;
前7名;
右:610;
}
#接触
{
位置:绝对位置;
背景:url(contact.png);
宽度:178;
身高:58;
排名前17位;
右:610;
左:125;
}
#rect1
{
宽度:716;
身高:308;
前-35名;
左:125;
}
#rect2
{
宽度:226;
身高:308;
前-35名;
左:850;
}
.直肠
{
位置:绝对位置;
背景:url(rect.png);
重复x;
重复y;
}
#特别的
{位置:绝对位置;
背景:url(special.png);
宽度:696;
身高:255;
前-30名;
左:132;
z指数:1000;
}
#裂缝
{
位置:绝对位置;
背景:url(chasb.png);
宽度:56;
身高:62;
前50名;
右:300;
z指数:1000;
}
#塔克特
{
位置:绝对位置;
背景:url(takhte.png);
宽度:51;
身高:58;
排名:170;
右:300;
z指数:1000;
}
#萨巴德1{
位置:绝对位置;
宽度:80;
身高:17岁;
排名前210名;
右:370;
z指数:1000;
}
#萨巴德2{
位置:绝对位置;
宽度:80;
身高:17岁;
排名前90名;
右:370;
z指数:1000;
}
萨巴德先生
{
背景:url(sabad.png);
}
#左
{
位置:绝对位置;
背景:url(slideleft.png);
排名:280;
左:125;
宽度:20;
身高:69;
z指数:2000;
}
#对
{
位置:绝对位置;
背景:url(slideright.png);
排名:280;
左:822;
宽度:17;
身高:69;
z指数:2000;
}
#滑梯
{
位置:绝对位置;
排名:280;
左:125;
宽度:716;
身高:69;
z指数:1500;
}
#职员
{
位置:绝对位置;
背景:url(staff.png);
宽度:228;
身高:70;
排名:280;
z指数:1000;
左:850;
}
#我的盒子
{
位置:绝对位置;
背景色:白色;
排名:0;
左:865;
宽度:200;
身高:260;
z指数:900;
}
#产品
{
位置:绝对位置;
背景:url(products.png);
宽度:200;
身高:76;
前-30名;
左:865;
z指数:1000;
}

正如我所说,通过包含doctype,它只会显示标题应该使用的唯一doctype是

我怀疑是因为缺少单位。我猜IE在这里没有使用默认值
px


宽度
高度
左侧
顶部
都应该有单位,请尝试在每个单位上添加一个
px
z-index当然不需要它。

该页面有大量CSS错误。当您没有doctype时,页面将在中处理,这意味着浏览器将模拟旧的、已损坏的IE版本。添加doctype会破坏这一点。例如,任何不带单位的长度表达式(0除外)都将被忽略


您需要决定是修复(或重写)代码以符合HTML和CSS规范,还是使用怪癖模式。

什么版本的internet explorer?问题也可能出现在你的css中,你也应该包括它。我希望它在所有浏览器中都能工作,我的ie版本是8至少你需要关闭元标记,比如/>,你需要为你的样式设置一个类型,比如你在Dreamweaver中做的?为什么你所有的元素都是绝对定位的?我正在将psd文件转换为css和html不,我不是在dream weaver中制作的