CSS3 Scale 不适用于 Firefox 34.0.5 中的 <a>

标签 css firefox transform scale

我有一个关于使用 CSS3 比例变换的问题。谁能解释为什么这种比例转换在 Firefox(目前使用 34.0.5)中不起作用,但在 Opera 中却起作用?

HTML:

<a href="#">hover me!</a>

CSS:

a {
  -webkit-transform: scale(1);
     -moz-transform: scale(1);
      -ms-transform: scale(1);
       -o-transform: scale(1);
          transform: scale(1);
  -webkit-transition: transform 1s ease-in;
     -moz-transition: transform 1s ease-in;
       -o-transition: transform 1s ease-in;
          transition: transform 1s ease-in;
}

a:hover {
  -webkit-transform: scale(1.5,1.5);
     -moz-transform: scale(1.5,1.5);
      -ms-transform: scale(1.5,1.5);
       -o-transform: scale(1.5,1.5);
          transform: scale(1.5,1.5);
}

>> JSFiddle here <<

最佳答案

将链接设置为display: inline-block

Updated Fiddle


Link 是一个内联元素。并且不能将 CSS 转换应用于 mentioned here。 :

Transforms apply to transformable elements.

Transformable elements are :

A transformable element is an element in one of these categories:

  • an element whose layout is governed by the CSS box model which is either a block-level or atomic inline-level element, or whose display property computes to table-row, table-row-group, table-header-group, table-footer-group, table-cell, or table-caption [CSS21]

  • an element in the SVG namespace and not governed by the CSS box model which has the attributes transform, ‘patternTransform‘ or gradientTransform [SVG11].

关于CSS3 Scale 不适用于 Firefox 34.0.5 中的 <a>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27430202/

相关文章:

javascript - FF4 中的控制台消息(以及一个愚蠢的 CSS 问题)

css - 悬停时完成 CSS 转换

html - 如何防止 <div> 在 Firefox 中 float 在其他 div 之上?

html - 删除不需要的水平滚动(水平滚动来自哪里?)

javascript - 尝试使用前进和后退按钮创建图像幻灯片

javascript - 简单 javascript 属性更改的一些错误

html - Firefox html 有序列表编号被子列表弄乱了

ruby-on-rails - 哈希数组的 transform_keys

html - CSS 悬停翻转器不工作

javascript - jQuery 条件头类交换