图像看起来像只在firefox中工作的按钮

时间:2015-02-19 22:49:58

标签: javascript jquery html css html5

这是我使用3个div创建的按钮。所有div都有hava图像,用于创建按钮。这是demo link

<div class="btncontainer" id="button">
        <a href="#">
            <div id='leftdiv'><img src="http://i.share.pho.to/ff6cc4e3_o.png" height="30px" />
            </div>
            <div id='backgrounddiv'>Click Me </div>
            <div id='rightdiv'><img src="http://i.share.pho.to/245be416_o.png" height="30px" />
            </div>

    </div>

我想要一个按钮外观,并将此代码添加为按钮。

    -webkit-appearance:button;
    -moz-appearance:button;
    -o-appearance:button;
    -ms-appearance:button;   

此按钮效果仅在Firefox中正常工作,但在chrome / IE中无法正确显示。有没有其他方式看起来像一个按钮,适用于所有浏览器?谢谢

1 个答案:

答案 0 :(得分:0)

使用

<button>Some text</button> 

<input type="button">

元素是使某些东西看起来像按钮的最可靠方法

编辑:

要使您的按钮在Firefox,Chrome和I / E中看起来保持一致,添加一些填充将显示灰色&#34;按钮&#34;您目前只在Firefox中看到的效果。 DEMO