当前位置: 动力学知识库 > 问答 > 编程问答 >

html - How to support css background image property for buttons in opera

问题描述:

css doesn't support background image property for buttons in opera web browser.I used css background image property for my own creation but it's doesn't appear when i use opera browser.when i use firefox it appear well... but i saw button background images support some websites in opera properly how can i do it in opera web browser?

ex: http://ikman.lk/en/ads-in-gampaha (see this web site's search button image...it appear well in opera)

网友答案:

The website you link to is simply using a button element with a span inside. The span has a CSS-gradient background. Inside the span is an i element, which has a search icon background image. They probably used this setup not because of problems with opera, but because they're using an image sprite and the nested i element could be made so small the other parts of the sprite image don't show even though the button is larger.

The button isn't doing any background-related stuff for the gradient or the icon, so it doesn't matter if Opera supports this or not.

By the way, Opera is using the Blink engine now, so if Chromium and Chrome support the property on buttons, so should Opera since version 15.

网友答案:

This icon is not a direct css background image of the button But of an I elemnet that is placed inside the button.

here is the html:

<button class="btn large search-btn" type="submit">
    <span>
         <i class="ico-search-btn"></i>
    </span>
</button>

and then they added a background to .ico-search-btn.

Did you tried it this way?

分享给朋友:
您可能感兴趣的文章:
随机阅读: