#foo{font-size:14px;}
Run Code Online (Sandbox Code Playgroud)
现在#foo的字体大小为14px
#foo{font-size:$-2px} // Hypothetical code
Run Code Online (Sandbox Code Playgroud)
现在#foo的字体大小为12px.(14px - 2px)
这有可能吗?动态更改选择器的值.
我希望你能看到这个小提琴:
HTML
<input id="rad1" type="radio" name="rad" checked>FLAT
<input id="rad2" type="radio" name="rad">3D
<div id="portrait"></div>
Run Code Online (Sandbox Code Playgroud)
CSS
#portrait{
margin-bottom:0px;
margin-top:20px;
width:300px;
height:200px;
background-color:#000;
transition: transform 2s, margin 1s;
-webkit-transition: -webkit-transform 2s, margin 1s;
}
input[type='radio']:checked + #portrait{
margin-left:50px!important;
transform: perspective( 700px ) rotateY( 30deg );
-webkit-transform: perspective( 700px ) rotateY( 30deg );
}
Run Code Online (Sandbox Code Playgroud)
请先在Firefox中打开它,看看它是如何正常工作的,然后在Chrome中打开以查看它是否有问题.我做错什么了吗?或者它确实是一个错误?
Firefox甚至不需要-moz-来生成转换和转换.. Chrome似乎有点问题..
我可以在所有浏览器中使用正确的动画吗?歌剧,即野生动物园?
这两者之间的区别是什么?我应该何时使用它们?
有时候除非用jQuery替换$,否则脚本将无效.