SOLVED Chrome bug, Stop CSS3 transition from firing on page load This might be a duplicate.
I'm getting something weird with the following code:
JsFiddle: https://jsfiddle.net/xz3hcbqv/ You can see it working fine here and if I export it to my own HTML file like so:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
.stripes {
cursor: pointer;
width: 35px;
}
.stripe {
width: 35px;
height: 5px;
margin: 6px 0;
transition: background-color 10s;
background-color: black;
}
label {
background-color: black;
}
input {
display: none;
background-color: black;
}
input:checked + .navbar-toggle .stripe {
background-color: red;
}
input:checked + .navbar-toggle .stripe.first {
-webkit-transform: rotate(-45deg) translate(-9px, 6px) ;
transform: rotate(-45deg) translate(-9px, 6px) ;
}
input:checked + .navbar-toggle .stripe.second {
opacity: 0;
}
input:checked + .navbar-toggle .stripe.third {
-webkit-transform: rotate(45deg) translate(-8px, -8px) ;
transform: rotate(45deg) translate(-8px, -8px) ;
}
</style>
<link rel="stylesheet" href="style2.css">
</head>
<body>
<nav class="navbar">
<input type="checkbox" id="navbar-toggle-cbox">
<label for="navbar-toggle-cbox" class="navbar-toggle collapsed">
<div class="stripes">
<div class="stripe first"></div>
<div class="stripe second"></div>
<div class="stripe third"></div>
</div>
</label>
</nav>
</body>
</html>
Still working fine, notice that it's the exact same code.
But then, when I copy the inner of <style> </style>
and put it into a style2.css file. On the browser load, it fades the black color as well.
What causes this? How can I solve this?