无法在 IE 8 中显示数据库中的图片
使用IE 8浏览我的显示购物车列表和图片的页面时,无法显示图片(.jpeg)和阴影效果。但其他浏览器工作正常..
这些图片是从相册中获取的缩略图,通过url链接,
下面是我的CSS。
body {
font-family:Helvetica-light;
font-size:14px;
padding:0;
margin:0;}
h1 {
font-weight:normal;
margin:0 0 10px 0;
}
h2, h3, h4, h5, h6 {
font-weight:normal;
}
a {
text-decoration:none;
color:#777;
display:block;
margin:0 0 10px 0;
}
a:hover {
text-decoration:underline;
}
:focus {outline:none;}
label { display:block; margin:0 0 5px 0;}
input {
display:block;
margin:0 0 5px 0;
}
input[type=submit] {
cursor:pointer;
}
table {
width:100%;
box-shadow:0 0 5px #CCC;
-webkit-box-shadow:0 0 5px #CCC;
-moz-box-shadow:0 0 5px #CCC;
-o-box-shadow:0 0 5px #CCC;
behavior: url(ie-css3.htc);
margin:0 0 10px 0;
}
table tr th {
text-align:left;
font-weight:bold;
padding:10px;
background:#F9F9F9;
}
table tr td {
padding:10px;
}
table tr.empty td {
background:#F9F9F9;
}
.clear { clear:both;}
.bold { font-weight:bold;}
#container {
width:960px;
margin:0 auto;
padding:20px;
box-shadow:0 0 10px #CCC;
-webkit-box-shadow:0 0 10px #CCC;
-moz-box-shadow:0 0 10px #CCC;
-o-box-shadow:0 0 10px #CCC;
behavior: url(ie-css3.htc);
}
.notify {
padding:10px;
background:#E9E9E9;
margin:0 0 10px 0;
}
.product {
float:left;
margin:0 10px 0 0;
box-shadow:0 0 10px #CCC;
-webkit-box-shadow:0 0 5px #CCC;
-moz-box-shadow:0 0 5px #CCC;
-o-box-shadow:0 0 5px #CCC;
behavior: url(ie-css3.htc);
}
.url{
behavior: url(ie-css3.htc);
}
.product .info {
float:left;
padding:10px;}
.product h3 {
margin:0 0 5px 0;
background:#F9F9F9;
padding:10px;
}
When browsing the pages of my display cart list and pictures with IE 8 , cannot show pictures ( .jpeg) and shadow effect. but other browser wroks fine..
The pictures are thumbnails that obtained from the photo album ,linked by url,
The below is my CSS.
body {
font-family:Helvetica-light;
font-size:14px;
padding:0;
margin:0;}
h1 {
font-weight:normal;
margin:0 0 10px 0;
}
h2, h3, h4, h5, h6 {
font-weight:normal;
}
a {
text-decoration:none;
color:#777;
display:block;
margin:0 0 10px 0;
}
a:hover {
text-decoration:underline;
}
:focus {outline:none;}
label { display:block; margin:0 0 5px 0;}
input {
display:block;
margin:0 0 5px 0;
}
input[type=submit] {
cursor:pointer;
}
table {
width:100%;
box-shadow:0 0 5px #CCC;
-webkit-box-shadow:0 0 5px #CCC;
-moz-box-shadow:0 0 5px #CCC;
-o-box-shadow:0 0 5px #CCC;
behavior: url(ie-css3.htc);
margin:0 0 10px 0;
}
table tr th {
text-align:left;
font-weight:bold;
padding:10px;
background:#F9F9F9;
}
table tr td {
padding:10px;
}
table tr.empty td {
background:#F9F9F9;
}
.clear { clear:both;}
.bold { font-weight:bold;}
#container {
width:960px;
margin:0 auto;
padding:20px;
box-shadow:0 0 10px #CCC;
-webkit-box-shadow:0 0 10px #CCC;
-moz-box-shadow:0 0 10px #CCC;
-o-box-shadow:0 0 10px #CCC;
behavior: url(ie-css3.htc);
}
.notify {
padding:10px;
background:#E9E9E9;
margin:0 0 10px 0;
}
.product {
float:left;
margin:0 10px 0 0;
box-shadow:0 0 10px #CCC;
-webkit-box-shadow:0 0 5px #CCC;
-moz-box-shadow:0 0 5px #CCC;
-o-box-shadow:0 0 5px #CCC;
behavior: url(ie-css3.htc);
}
.url{
behavior: url(ie-css3.htc);
}
.product .info {
float:left;
padding:10px;}
.product h3 {
margin:0 0 5px 0;
background:#F9F9F9;
padding:10px;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
behavior: url(ie-css3.htc);
不使用与background-image: url();
相同的路径结构,这不会在您的 CSS 目录中查找位于您网站的文档根目录中。确保可以从 http://yourwebsite.com/ie-css3.htc 访问此文件
另外,我会更改 box-shadow CSS 声明的顺序,如下所示:
由于 CSS“级联”,支持
box-shadow
但保留-webkit-box-shadow
的浏览器出于遗留原因,代码>周围将使用代码布局方式不标准-webkit-box-shadow
。通过将box-shadow
移至底部,我们确保支持该标准的浏览器将使用它。behavior: url(ie-css3.htc);
does not use the same path structure asbackground-image: url();
This will not look in the directory your CSS lives in, but rather the docroot of your site. Be sure that this file is accessible from http://yourwebsite.com/ie-css3.htc
Also, I would change the order of your box-shadow CSS declarations like follows:
Since CSS "cascades", a browser that supports
box-shadow
but keeps-webkit-box-shadow
around for legacy reasons would use the non-standard-webkit-box-shadow
in how your code was laid out. By movingbox-shadow
to the bottom, we ensure that browsers who support the standard will use it.