0

我在 ie8 中遇到了 CSS text justify 问题,需要创建一个 ie8 特定规则来解决该问题,但无法弄清楚。

页面和文本应该如下所示:链接到页面(使用现代浏览器,如 Chrome / Safari / Firefox)。

附加的图片显示 ie8 搞砸了间距。在此处输入图像描述

CSS

/*Fancybox Gallery Divs*/


#thumbs {   
    width: 960px;
    margin-top:20px;
    margin-left: auto; 
    margin-right: auto;
    text-align: justify;
    -ms-text-justify: distribute-all-lines;
    text-justify: distribute-all-lines;
}

#thumbs a {
    vertical-align: top;
    display: inline-block;
    *display: inline;
    zoom: 1;
}

.stretch {
    width: 100%;
    display: inline-block;
    font-size: 0;
    line-height: 0
}

/*Descriptions*/


#desc-wrapper {
    width: 960px;
    padding-top: 5px;
    margin-left: auto; 
    margin-right: auto;
    text-align: justify;
    -ms-text-justify: distribute-all-lines;
    text-justify: distribute-all-lines;
}

.description {
    float:left;
    width: 320px; // Increase/decrease width for margin between images
    height: 25px;
    text-align: center;
    margin-bottom: 30px;
}

.clear {
    clear:both;
}

HTML

<!--/ Photo Thumbs Row 1-->

<div id="thumbs">

<a id="single_image" href="/bp/images/roscoes-run.jpg"><img src="/bp/images/roscoes-run(thumb).jpg" alt=""/></a>
<a id="single_image" href="/bp/images/roscoes-run-2.jpg"><img src="/bp/images/roscoes-run-2(thumb).jpg" alt=""/></a>
<a id="single_image" href="/bp/images/chicken-waffles.jpg"><img src="/bp/images/chicken-waffles(thumb).jpg" alt=""/></a>

<span class="stretch"></span>


</div>

<!--/ Description-->

<div id="desc-wrapper">
<div class="description">Roscoe's Run 2012</div>
<div class="description">Roscoe's Run 2012</div>
<div class="description">Roscoe's Run 2012</div>
<div class="clear"></div>
</div>




<!--/ Photo Thumbs Row 2-->

<div id="thumbs">

<a id="single_image" href="/bp/images/mens-retreat-2012.jpg"><img src="/bp/images/mens-retreat-2012(thumb).jpg" alt=""/></a>
<a id="single_image" href="/bp/images/winter-retreat-2012.jpg"><img src="/bp/images/winter-retreat-2012(thumb).jpg" alt=""/></a>
<a id="single_image" href="/bp/images/new-years-eve-2012.jpg"><img src="/bp/images/new-years-eve-2012(thumb).jpg" alt=""/></a>


<span class="stretch"></span>

</div>


<!--/ Description-->

<div id="desc-wrapper">
<div class="description">Men's Retreat 2012</div>
<div class="description">Winter Retreat 2012</div>
<div class="description">New Year's Eve 2012</div>
<div class="clear"></div>
</div>
4

2 回答 2

1

罪魁祸首是:

text-justify: distribute-all-lines;

在#desc-wrapper 上(顺便说一下,这是一个重复的ID,这应该是一个类)。要么从 media.css 和 media-ie8.css 中删除它(不确定为什么需要它),要么在 media-ie8.css 中将其覆盖为自动。不过,说真的,它是一个仅限 IE 的属性。只是删除它?

于 2013-03-29T23:49:18.247 回答
0

好吧,您需要添加条件注释,因为您的 ie-css 被常规 media.css 覆盖

<!--[if IE 8]>
your stuff
<![endif]-->
于 2013-03-29T23:42:52.650 回答