Css Internet Explorer和后台未显示的问题
我有一些问题,我的背景没有显示我的按钮元素 以下是我的CSS代码:Css Internet Explorer和后台未显示的问题,css,Css,我有一些问题,我的背景没有显示我的按钮元素 以下是我的CSS代码: button.button-master-lite, a.button-master-lite { background: #92AE41; background: -moz-linear-gradient(top, #89A73E 0%, #92AE41 100%); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#89A73E),
button.button-master-lite, a.button-master-lite {
background: #92AE41;
background: -moz-linear-gradient(top, #89A73E 0%, #92AE41 100%);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#89A73E), to(#92AE41));
border: 1px solid #89A73E;
border-bottom: 1px solid #92AE41;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
-moz-box-shadow: inset 0 1px 0 0 #92AE41;
-webkit-box-shadow: inset 0 1px 0 0 #92AE41;
box-shadow: inset 0 1px 0 0 #92AE41;
color: #fff;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
font-size: 11px;
font-weight: bold;
line-height: 1;
padding: 5px 8px 6px 8px;
text-align: center;
text-shadow: 0 -1px 0 #5D862F;
width: auto;
}
这是我的HTML:
<a class="button-master-lite" href="#">Order Now</a>
对于IE 6和IE 7,背景色不显示。然而,当我去掉除第一个之外的其他背景声明时,背景显示出来
我有这个按钮的HTML页面有很多div和sub div,其中包含float和position样式元素,但我无法确定是哪一个导致了这个问题。我试着把代码放在一个完全空白的页面上,只有我的样式表,效果很好
当我有其他浏览器的背景声明时,是否有什么特别的东西会导致背景不显示?!它是否与浮动或其他定位元素有关
我非常感谢你的帮助。谢谢。您在设置背景后立即重置背景。使用
background color
设置颜色,然后使用background image
设置那些CSS3渐变
演示:
这个网站帮助很大!
您在设置背景后立即重置背景。使用
background color
设置颜色,然后使用background image
设置那些CSS3渐变
演示:
这个网站帮助很大!
添加
显示:块
或显示:内联块
添加显示:块
或显示:内联块
尝试使用背景色和背景图像属性,如下所示:
button.button-master-lite, a.button-master-lite {
background-color: #92AE41;
background-image: -moz-linear-gradient(top, #89A73E 0%, #92AE41 100%);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#89A73E), to(#92AE41));
border: 1px solid #89A73E;
border-bottom: 1px solid #92AE41;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px; -moz-box-shadow: inset 0 1px 0 0 #92AE41;
-webkit-box-shadow: inset 0 1px 0 0 #92AE41;
box-shadow: inset 0 1px 0 0 #92AE41;
color: #fff;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
font-size: 11px;
font-weight: bold;
line-height: 1;
padding: 5px 8px 6px 8px;
text-align: center;
text-shadow: 0 -1px 0 #5D862F;
width: auto;
}
尝试使用背景色和背景图像属性,如下所示:
button.button-master-lite, a.button-master-lite {
background-color: #92AE41;
background-image: -moz-linear-gradient(top, #89A73E 0%, #92AE41 100%);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#89A73E), to(#92AE41));
border: 1px solid #89A73E;
border-bottom: 1px solid #92AE41;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px; -moz-box-shadow: inset 0 1px 0 0 #92AE41;
-webkit-box-shadow: inset 0 1px 0 0 #92AE41;
box-shadow: inset 0 1px 0 0 #92AE41;
color: #fff;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
font-size: 11px;
font-weight: bold;
line-height: 1;
padding: 5px 8px 6px 8px;
text-align: center;
text-shadow: 0 -1px 0 #5D862F;
width: auto;
}
您可以将字体系列、字体大小、字体重量和行距规则组合成:
font:bold 11px/1“Lucida Grande”、“Lucida Sans Unicode”、“Lucida Sans”、日内瓦、Verdana、无衬线
您可以将字体系列、字体大小、字体重量和行距规则组合成:字体:粗体11px/1“Lucida Grande”、“Lucida Sans Unicode”、“Lucida Sans”、日内瓦、Verdana、无衬线我不知道为什么我会被否决?这可能是一个他可能错过的属性,并导致背景不显示,因为锚标记是内联元素。我猜你被否决了,因为他说的是颜色不显示。显示块或内联与此无关。我对你的评论投了赞成票。虽然问题可能是关于颜色不显示,但显示属性可以而且确实会对这些事情产生影响,特别是对于非块级别的元素,例如“a”标记……即使在使用按钮和标记时,我也遇到了同样的问题,即使在显示时:块定义。不过谢谢你的建议。没问题,只是想帮帮忙。但是如果你用的是带display:block的a标签,你可能缺少宽度和高度。不知道我为什么会投反对票?这可能是一个他可能错过的属性,并导致背景不显示,因为锚标记是内联元素。我猜你被否决了,因为他说的是颜色不显示。显示块或内联与此无关。我对你的评论投了赞成票。虽然问题可能是关于颜色不显示,但显示属性可以而且确实会对这些事情产生影响,特别是对于非块级别的元素,例如“a”标记……即使在使用按钮和标记时,我也遇到了同样的问题,即使在显示时:块定义。不过谢谢你的建议。没问题,只是想帮帮忙。但是如果你使用的是带有display:block的标签,你可能缺少宽度和高度