Willard
Willard

Reputation: 425

IE8 CSS Text Spacing Issue

I'm running into a CSS text justify issue in ie8 and need to create a ie8 specific rule to address the issue, but haven't been able to figure it out.

The page & text is supposed to look like so: Link to Page (Use modern browser like Chrome / Safari / Firefox).

Img attached showing ie8 messed up spacing.enter image description here

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>

Upvotes: 0

Views: 346

Answers (2)

Ben
Ben

Reputation: 126

The culprit is:

text-justify: distribute-all-lines;

on the #desc-wrapper (which, by the way, is a repeated ID, this should be a class). Either remove it from both media.css and media-ie8.css (not sure why it's necessary) or override it in media-ie8.css to auto. Seriously, though, it's an IE-only property. Just remove it?

Upvotes: 1

kelly johnson
kelly johnson

Reputation: 1636

well, you need to add a conditional comment as your ie-css is being overridden by the regular media.css

<!--[if IE 8]>
your stuff
<![endif]-->

Upvotes: 0

Related Questions