CSS不能与IE和Firefox一起使用,但可以在Chrome中使用

时间:2015-03-05 19:10:47

标签: html css wordpress internet-explorer

网站jgimprinters.com加载并在Chrome中正常运行,但在IE或Firefox中无效。 我已经确认IE下载了样式表,但它并没有应用很多样式。 例如,在IE中,应该以全尺寸隐藏的菜单按钮显示并且全部被吹灭(太大),菜单样式都没有工作,几件事的背景颜色不起作用。虽然IE可以看到样式表,但它并没有应用样式。

任何帮助都将不胜感激。

由于

编辑:不起作用的片段 - 对于初学者来说,存在整个导航 - 并且导航下方缺少标题

#nav-wrapper{
	max-width:900px;
	margin:0 auto;
}
#nav{
	list-style:none;
	
}
#nav li{
	float:left;
}
#nav li a{
	webkit-border-radius: 6px 6px 0 0;
-moz-border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
padding: 0 17px;
margin: 0 auto;
position: relative;
display: block;
height: 30px;
cursor: pointer;
text-decoration: none;
color: #FFFFFF;
line-height: 30px;
text-align: center;
font-size:12px;
font-weight:bold;

}
#nav li a.active, #nav li a.better-active{
	background: #EDEDED;
	color: #5D5F5D;
}
#nav li a:hover{
	background:#5D5F5D;
	color:#ffffff;
}
#menu-button{
	display:none;
	width:36px;
	cursor:pointer;
}
#menu-button img{
	margin:0px;
}
#head-wrapper{
	height:150px;
	background:url('/wp-content/uploads/2015/02/header.png') no-repeat;
	background-position:center;
	width:100%;
	display:block;
	
}
#head-inner{
	width:100%;
	max-width:900px;
	margin:0 auto;
}

#logo{
	margin-left:30px;
	float:left;
}
#head-right{
	float:right;
	width:270px;
	margin-top:30px;
	margin-right:15px;
}
#callout{
	font-size: 14px;
font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif;
font-weight: bold;
font-style: normal;
text-decoration: none;
text-transform: none;
font-variant: normal;
text-align: left;
color: #ED1D2E !important;
width:280px;

}
#phone{
	font-size: 30px;
font-family: 'Trebuchet MS', Arial, Helvetica, Sans-Serif;
font-weight: bold;
font-style: normal;
text-align: left;
vertical-align: middle;
color: #000000 !important;
text-decoration:none;
}

所有这一切都被IE和Firefox忽略了。

看起来像: IE screenshot

应该是这样的: enter image description here

1 个答案:

答案 0 :(得分:1)

第385行的styles.css文件中存在语法错误,Chrome似乎为您修复,而其他浏览器则没有。

… url(/wp-content/uploads/2015/02/nav.png') …

有一个尚未打开的关闭撇号。之后的所有CSS都没有被解析。

我是怎么知道的?

我在my favorite editor打开了样式表,发现在第385行之后一切都是黄色的 - 这是字符串的颜色。

Sublime screenshot

但是,验证CSS也会有所帮助,因为它也发现了错误(等等):

386 #main-nav   Value Error : background top is not a color value ) no-repeat, …