Css 为什么我的网页不能在IE中工作?
我的网页不能与IE一起使用。我用W3C完全验证了我的网页,并且我确保不使用所有浏览器都不支持的任何东西,至少我认为我这样做了 我想我是用IE8测试的,我没有安装IE,只是用了一个免费的网络程序 基本上,IE的侧边栏占据了页面的全部空间,然后网站的其余部分都在侧边栏下面。顺便说一句,我不能把事情变成绝对的。我绝对不能把它改成绝对的哈哈Css 为什么我的网页不能在IE中工作?,css,internet-explorer,Css,Internet Explorer,我的网页不能与IE一起使用。我用W3C完全验证了我的网页,并且我确保不使用所有浏览器都不支持的任何东西,至少我认为我这样做了 我想我是用IE8测试的,我没有安装IE,只是用了一个免费的网络程序 基本上,IE的侧边栏占据了页面的全部空间,然后网站的其余部分都在侧边栏下面。顺便说一句,我不能把事情变成绝对的。我绝对不能把它改成绝对的哈哈 谢谢您的帮助。您应该强制IE8使用edge进行渲染: 它可以放在HTML的头部: <!DOCTYPE html> <html> &
谢谢您的帮助。您应该强制IE8使用edge进行渲染: 它可以放在HTML的头部:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- other head tags -->
</head>
<body>
</body>
</html>
这几乎肯定只会对Internet Explorer 9及以上版本有所帮助…@pwdst X-UA-Compatible header受IE8及更高版本的支持。是的,但其效果是强制Internet Explorer不使用兼容模式进行渲染-不添加对任何缺失的标准JavaScript的支持,HTML5或CSS3或更改非标准API或box模型。我刚刚下载了IE,得到了最新版本,它可以在上面工作。那么这段代码会有帮助吗?如何应用?@user3148769此meta标记应放在HTML的标题中。我更新了答案以显示此标记,或将其添加到对生产站点有用的Web服务器标题中。是的,我在Windows XP上用IE8进行了测试,它迫使浏览器脱离怪癖模式,进入IE8兼容性。你的CSS组织给我留下了深刻的印象。除非您想要垃圾邮件,否则您可能希望从代码中删除您的电子邮件。创建联系人表单可能是接收消息的更好方式。上的答案之一可能会有所帮助。请尝试在侧边栏中添加float:left
/***************************************** Info *********************************************************/
/*Style Sheet for HomePage of adrianhoulewebprojects.com*/
/*Written by Adrian Houle*/
/*For any issues with my website (compatibility, accessibility, white-hat reports) feel free to contact me at
adrianhoule@gmail.com
/*Page Purpose: Create a homepage that welcomes users to my website and directs them to various projects*/
/***********************************************************************************************************/
/************************************* Table of Contents **************************************************/
/*CSS layout*/
/* -none specific elements*/
/* -classes*/
/* -ID's and children of ID's*/
/* -Other*/
/************************************************************************************************************/
/************************************** CSS code ****************************************************/
/* -none specific elements ***********************************************************************************/
p {
font-size: large;
font-weight: bolder;
}
a {
color: blue;
}
a:hover, a:focus{
background-color: yellow;
text-decoration: none;
font-size: larger;
}
/* -classes **************************************************************************************************/
/*Element that contains everything except the sidebar and has the main background image.*/
.box {
display: block;
position: relative;
width: 100%; /*test and adjust to keep it from expading the browser*/
height: 100%;
border: 3px solid black;
right: 0;
top: 0px;
padding: 0;
background-image: url(http://www.adrianhoulewebprojects.com/img/CautionStripes.png);
}
/*Allows for synchronised space adjustment between elements*/
.Spacer {
position :relative;
height: 100px;
}
/*Allows for synchronised space adjustment between elements*/
.HalfSpacer {
position :relative;
height: 30px;
}
/*Every element that contains text belongs to this class*/
/*This class has nothing to do with transgender boxes, or gender boxes in general*/
.TransBox {
width: 70%;
padding: 1em;
z-index: 1;
left: 20%;
position: relative;
background-image: url(http://www.adrianhoulewebprojects.com/img/SteelPlate.jpg);
moz-box-shadow: 0 0 5px 5px #888; /*shadow effect with cross compatibility*/
webkit-box-shadow: 0 0 5px 5px#888;
box-shadow: 0 0 5px 5px #888;
}
.Italic {
font-style: Italic;
}
/* -ID's and children of ID's********************************************************************************/
/*Sidebar, to be fixed to the left hand side of the screen. Must allow conent to the right of it*/
#Sidebar {
height: 100%;
width: 10%;
left: 0px;
top: 0px;
padding: 2%;
display: inline;
position: fixed;
background-image: url(http://www.adrianhoulewebprojects.com/img/SteelPlate.jpg);
border-style: solid;
border-width: 3px;
z-index: 2;
}
#Sidebar ul {
padding-left:0;
}
#Sidebar li {
margin: 10%;
}
/*Header text*/
#Header h1 {
text-align: center;
}
#Footer p {
text-align: center;
}
/* -Other (empty)*****************************************************************************************/
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- other head tags -->
</head>
<body>
</body>
</html>