Skip to content

Instantly share code, notes, and snippets.

@tosbourn
Created March 24, 2013 17:12
Show Gist options
  • Save tosbourn/5232678 to your computer and use it in GitHub Desktop.
Save tosbourn/5232678 to your computer and use it in GitHub Desktop.
Some sample code to show off how Firefox treats !important when used with CSS animations
<html>
<head>
<title>Wee Animation Test</title>
<style>
.awesome_but_not_important {
height: 150px;
width: 150px;
background-color: red;
padding: 5px;
-webkit-animation: awesome 5s linear infinite;
animation: awesome 5s linear infinite;
}
.awesome_and_important {
height: 150px ! important;
width: 150px ! important;
background-color: green;
padding: 5px;
-webkit-animation: awesome 5s linear infinite;
animation: awesome 5s linear infinite;
}
@-webkit-keyframes awesome {
50% { height: 250px; width: 250px; }
}
@keyframes awesome {
50% { height: 250px; width: 250px; }
}
</style>
</head>
<body>
<div class="awesome_but_not_important">I am awesome, but not important so I animate in every browser that supports it.</div>
<div class="awesome_and_important">I am awesome and important so I animate in every browser that supports it except Firefox that takes my important into account.</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment