简体   繁体   中英

Strange white text in IE7 and IE8

I'm having a problem with some text that is meant to be black. Only in IE7 and IE8 is the text white (in IE6 it is black).

The text is in a paragraph within a slideshow and I've tried all I can think of; pointing at it very specifically with CSS and doing color:#000;. I also tried pointing at it with jQuery to no avail. When I load the page, it begins as black then instantly turns white.

Many Thanks

I finally cracked it! It was to do with a CSS opacity filter. It's strange though because the opacity filter was set to the element's sibling .

ex:

<h3 (opacity set on bg of this, given height, absolute position etc) >
Bla bla bla</h3>
<div (absolutely positioned above h3 sibling) >
    <div>
        <p>Problem text here</p>
    </div>
</div>

I tried setting the z-index of the div to be on top of the h3 but it doesn't work in IE8 and 7. Anyway, applying filter:none; in my IE8 stylesheet HAS worked! :)

尝试给p标签直接样式

<p style="color: #000 !important;">hjskhjakfhjkshfjdhkja</p>

Okay maybe another try:

You said it switches to white suddenly... Do you have some code in your jQuery file, that triggers after the page is loaded completely?

And another way to find out where the problem is located: disable js or css in the development settings and see what happens.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM