我正在为我正在开发的新网站制作一些粗略的示例。
由于某种原因,firefox(最新)中的后两个按钮将稍微移动文本,就像在进入活动状态时实现单击动画一样。为什么第一个按钮不会也遇到这个问题?
下面的代码
<fieldset style="width:320px; float:left;">
<legend>Pink Button</legend>
<button class="pinkbutton"><span>MESSAGE HERE</span></button>
<button class="pinkbuttondisabled" disabled="disabled"><span>DISABLED</span></button>
</fieldset>
<fieldset style="width:320px; float:left;">
<legend>Grey Button</legend>
<button class="greybutton"><span>MESSAGE HERE</span></button>
<button class="greybuttondisabled" disabled="disabled"><span>DISABLED</span></button>
</fieldset>
<fieldset style="width:320px; float:left;">
<legend>White Button</legend>
<button class="whitebutton"><span>MESSAGE HERE</span></button>
<button class="whitebuttondisabled" disabled="disabled"><span>DISABLED</span></button>
</fieldset>
下面的CSS
.pinkbutton { border:1px solid #D2247b; width:150px; height:30px; background-color:#EF0093; color:#FFF;}
.pinkbutton:hover {border:1px solid #FF4296; background-color:#FF5EAC;}
.pinkbutton:active {border:1px solid #A61D61; background-color:#DC2F85; color:#333232;}
.pinkbuttondisabled {border:1px solid #F3C4DB; width:150px; height:30px; background-color:#FDC6E2; color:#FFF;}
.greybutton { border:1px solid #BBBBBB; width:150px; height:30px; background-color:#E2E2E2; color:#8d8c8c;}
.greybutton:hover {border:1px solid #EF0093; background-color:#E2E2E2; color:#f62c92;}
.greybutton:active {border:1px solid #696969; background-color:#BFBFBF; color:#424242;}
.greybuttondisabled {border:1px solid #D5D4D4; width:150px; height:30px; background-color:#F4F4F4; color:#d5d4d4;}
.whitebutton { border:1px solid #EF0093; width:150px; height:30px; background-color:#FFF; color:#EF0093;}
.whitebutton:hover {border:1px solid #898989; background-color:#FFF; color:#898989;}
.whitebutton:active {border:1px solid #898989; background-color:#E2E2E2; color:#979696;}
.whitebuttondisabled {border:1px solid #FAB2DE; width:150px; height:30px; background-color:#FFF; color:#FAB2DE;}
任何帮助将不胜感激
似乎 :active 状态有一些填充。我添加了“填充:0;”到最初的 css 声明(以便无论状态如何都会继承它)并解决了问题。
请看这个jsfiddle http://jsfiddle.net/pxx4V/.
我不知道为什么它只发生在最后两个按钮上。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)