I have an html file that there is one div that is displayed/hidden based on the screen size and a scrolling text div. When the window reaches the "hidden" threshold, it looks like the CSS for the unrelated scrolling text becomes ignored? What am I missing?
HTML:
<html>
<head>
<style>
* {
box-sizing: border-box;
}
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
[class*="col-"] {
float: left;
padding: 15px;
}
.row::after {
content: "";
clear: both;
display: table;
}
/* This seems to be the culprit */
@media screen and (max-width: 1000px) {
div.graphic {
display: none;
}
#scroll-container {
border: 3px solid black;
border-radius: 5px;
overflow: hidden;
}
#scroll-text {
font-weight: bold;
font-size: 30px;
/* animation properties */
-moz-transform: translateX(100%);
-webkit-transform: translateX(100%);
transform: translateX(100%);
-moz-animation: my-animation 15s linear infinite;
-webkit-animation: my-animation 15s linear infinite;
animation: my-animation 15s linear infinite;
}
/* for Firefox */
@-moz-keyframes my-animation {
from { -moz-transform: translateX(100%); }
to { -moz-transform: translateX(-100%); }
}
/* for Chrome */
@-webkit-keyframes my-animation {
from { -webkit-transform: translateX(100%); }
to { -webkit-transform: translateX(-100%); }
}
@keyframes my-animation {
from {
-moz-transform: translateX(100%);
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
to {
-moz-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
}
</style>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div class="row">
<div class="col-5 graphic">
test
</div>
</div>
<div class="row">
<div class="col-12">
<p>Your message will appear as:</p>
<div id="scroll-container" >
<div id="scroll-text">Countdown </div>
</div>
</div>
</div>
</html>