0

我正在使用未排序列表来显示带有 a 标签的图像,以在每个图像上实现灯箱以查看更大版本的图像。在 Mozilla Firefox、Google chrome 和 Opera 上,图像以正确的大小显示,但在 Internet Explorer 中它们更小。

W3C Validator 报告 0 个错误,我声明了 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" />
<title>Makeup Artist - Hair Stylist | Natalie Bennet</title>
<link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />
</head>

<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="js/mouseoverscroll.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.5.js" ></script>
<div id="border"></div>
<div id="hide"></div>
<div id="header" align="center">
<div id="logo" align="center">
<img src="images/makeup-artist-hair-stylist.jpg" alt="Natalie Bennett" />
</div>
</div>
<div class="footer-arrow previous" style="left:1%; position:fixed;">
<img src="images/left-arrow-out.png"
onmouseover="this.src='images/arrow-left-on.png'"
onmouseout="this.src='images/left-arrow-out.png'" alt="previous" /></div>
<div class="galleryWrapper">
<ul class="galleryItems" style="list-style-type:none;">
<li><a href="images/portfolio/big/Sofia_1.jpg"><img class="portfolio" src="images/portfolio/Sofia_1.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Sofia_2.jpg"><img class="portfolio" src="images/portfolio/Sofia_2.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Sofia_3.jpg"><img class="portfolio" src="images/portfolio/Sofia_3.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Sofia_4a.jpg"><img class="portfolio" src="images/portfolio/Sofia_4a.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Sofia_4b.jpg"><img class="portfolio" src="images/portfolio/Sofia_4b.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Sofia_4.jpg"><img class="portfolio" src="images/portfolio/Sofia_4.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Sofia_5.jpg"><img class="portfolio" src="images/portfolio/Sofia_5.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Andro_1.jpg"><img class="portfolio" src="images/portfolio/Andro_1.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Andro_2.jpg"><img class="portfolio" src="images/portfolio/Andro_2.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Andro_3.jpg"><img class="portfolio" src="images/portfolio/Andro_3.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/Andro_4.jpg"><img class="portfolio" src="images/portfolio/Andro_4.jpg" alt="" /></a></li>
[...]
<li><a href="images/portfolio/big/T1.jpg"><img class="portfolio" src="images/portfolio/T1.jpg" alt="" /></a></li>
<li><a href="images/portfolio/big/T2.jpg"><img class="portfolio" src="images/portfolio/T2.jpg" alt="" /></a></li>
</ul>
</div>
<div class="footer-arrow next" style="left:96.5%; position:fixed;">
<img src="images/right-arrow-out.png"
onmouseover="this.src='images/arrow-right-on.png'"
onmouseout="this.src='images/right-arrow-out.png'" alt="next" /></div>
<div id="footer">
<div id="site-navigation" align="center">
<ul>
<li><a href="javascript:void(0)" class="active">Portfolio</a></li>
<li><a href="javascript:closeThenNavigate('about.php')">About</a></li>
<li><a href="javascript:closeThenNavigate('backstage.php')">Backstage</a></li>
<li><a href="javascript:closeThenNavigate('contact.php')">Contact</a></li>
</ul>
</div>
<div id="footer-menu">
</div>
<div id="copyright">
&copy; Natalie Bennett 2012
</div>
</div> 
<script type="text/javascript">
    $('.galleryItems a').lightBox({fixedNavigation:true});
openFooter();
var menuopen = false;
function openFooter(){
$('#footer').animate({
height: 40,
bottom:0
}, 750, 'linear');

}

function closeFooter(){
$('#footer').animate({
height: 20,
bottom:0
}, 750, 'linear');

$('#footer-button').css("backgroundPosition","center 0px");
}

var currentImage = 0;

function closeThenNavigate(url)
{
 $('#footer').animate({
 height: 20,
bottom:0
}, 750, 'linear', function() {
  window.location.href=url+"?i="+currentImage;
});
}
</script>
</body> 
</html>

这是图像的CSS:

img {
    border:none;
}
ul{
    padding:0px;
}
.galleryWrapper{
    top:6%; 
    left:0px; 
    width:100%;
    height:100%; 
    display:inline-block;
    position: fixed;
    width:100%;
    overflow:hidden;

}
.galleryItems li {
    list-style-type: none;
    float:left;
}

.portfolio{   
    widht:80%;
    height:88%;
    margin: 6px;
    cursor:pointer;
    margin-bottom:250px;;
}

你知道为什么它们在 IE 中更小吗?

编辑,忘记链接:http ://www.zackdibe.com/final/

4

3 回答 3

1

使用像素而不是宽度和高度大小的 % ...

于 2012-11-11T15:32:37.907 回答
0

确实使用像素而不是 % 或使用它。IE7/8 为地址栏使用了相当大的区域(例如 Chrome 或 FF 更大),因此可视区域更小,从中计算百分比。

于 2012-11-11T15:37:52.683 回答
0

给元素一个position:relative;.portfolio,然后尝试。

于 2012-11-11T16:09:01.113 回答