简体   繁体   中英

html - css check for chrome, ie & firefox

css works for firefox but not ie or chrome. How to fix the css so that at least IE works like firefox.

Firefox:

在此处输入图像描述

IE:

在此处输入图像描述

The image is in the background as well but should be transparent.

Chrome:

在此处输入图像描述

The HTML :

<center><div id="slideshowContentArea" style="display:none; width:500px; height:300px">
    <div class='nav'><a id='prev' href='#'>Prev</a>&nbsp&nbsp<a id='next' href='#'>Next</a></div> 
    <div id="slideshow" class="pics" style="position: relative; overflow-x: hidden; overflow-y: hidden; height:250px; width:395px">&nbsp;</div>
</div></center>

        $('#slideshow').cycle(
            { fx: 'fade', timeout: 3000, speed: 500, 
              pager: '#slideshow', before: setBGBefore, prev:'#prev',next:'#next',after:onAfter
            }
            );
        function setBGBefore() {
        $(this).css({ 'background-image': 'url(' + $(this).find('img').attr('src') + ')', 
        'background-position': 'center top', 'background-color': 'transparent' });
        $(".welcomeBox div").html($(this).find('span').html());
        }

jQuery can tell you the browser in use:

http://api.jquery.com/jQuery.browser/

Update. The question title was " check for chrome, ie & firefox " that's what I've answered. It's up to the OP if he wishes to implement a more elegant solution.

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