문제

We have some ads on our site delivered by an ad server. You know ads are delivered by lots of JavaScript, redirect, flash and all this ugly stuff.

Most of the time everything works.

But on some rare conditions like older browsers or whatever, the ad does not have the correct position and is lying above the content (not on purpose like a popup, layer or interstitial what we don't have at all)

I don't want to have ads lying above my content so if they do something wrong they should not show up at all.

All this ad markup is in a <div id="ad">...</div>. Is there a reliable way to have all this content stacked behind the other content regardless of what is pushed inside this div?

Answers like "Tell the adserver/campaing manager/etc to do the right thing" does not help me. I need a technical solution on my site.

도움이 되었습니까?

해결책

How about z-index:

Just set all your divs to something like 10 and all adds to 0.

i.e

div { /*so all your website content appears on top*/
    z-index: 10;
}

.myadd {
    z-index: 0;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top